Getting some help with regards to compatiblity problem with windows 10

Hello everyone ,
I am new user to R language and I my problem is that when i try to use the xlsx file after downloading its library I get an error.( I use windows 10)
What should I do ?

library(xlsx)**
Error: package or namespace load failed for ‘xlsx’:
.onLoad failed in loadNamespace() for 'rJava', details:
call: fun(libname, pkgname)
error: JAVA_HOME cannot be determined from the Registry
In addition: Warning message:
package ‘xlsx’ was built under R version 3.5.3
Error: package or namespace load failed for ‘xlsx’:
.onLoad failed in loadNamespace() for 'rJava', details:
call: fun(libname, pkgname)
error: JAVA_HOME cannot be determined from the Registry
In addition: Warning message:

package ‘xlsx’ was built under R version 3.5.3
Error: package or namespace load failed for ‘xlsx’:
.onLoad failed in loadNamespace() for 'rJava', details:
call: fun(libname, pkgname)
error: JAVA_HOME cannot be determined from the Registry
In addition: Warning message:
package ‘xlsx’ was built under R version 3.5.3

> library(xlsx)
Error: package or namespace load failed for ‘xlsx’:
** .onLoad failed in loadNamespace() for 'rJava', details:**
** call: fun(libname, pkgname)**
** error: JAVA_HOME cannot be determined from the Registry**
In addition: Warning message:
package ‘xlsx’ was built under R version 3.5.3

Hi!
The package xlsx depends on Java.You might want to look at readxl for reading .xls(x) files, and openxlsx for writing. They do not depend on Java.

If you still want to use xlsx you have to set the path to your Java installation in the JAVA_HOME variable, you can add a command like this to your Rprofile.site file (modify the path accordingly to your own installation).

Sys.setenv('JAVA_HOME'="C:/Program Files/Java/jdk-11.0.1/")

Thank you for your help, I really appreciate it

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.