Hi, I'm new to R and trying to use xlsx. I can't get it to run - please see the below error message. I've tried to install a recent java version but it didn't seem to fix the problem. I am using 10.13.6 Mac High Sierra OS .Could anyone help? Thank you.
library(xslx)
Error in library(xslx) : there is no package called ‘xslx’
The downloaded binary packages are in
/var/folders/rq/5mw7b6_j4wj18s5vvdd8d36r0000gn/T//RtmpHqeU5G/downloaded_packages
library(xlsx)
Unable to find any JVMs matching version "(null)".
Error: package or namespace load failed for ‘xlsx’:
.onLoad failed in loadNamespace() for 'rJava', details:
call: dyn.load(file, DLLpath = DLLpath, ...)
error: unable to load shared object '/Library/Frameworks/R.framework/Versions/3.6/Resources/library/rJava/libs/rJava.so':
dlopen(/Library/Frameworks/R.framework/Versions/3.6/Resources/library/rJava/libs/rJava.so, 6): Library not loaded: /Library/Java/JavaVirtualMachines/jdk-11.0.1.jdk/Contents/Home/lib/server/libjvm.dylib
Referenced from: /Library/Frameworks/R.framework/Versions/3.6/Resources/library/rJava/libs/rJava.so
Reason: image not found
In addition: Warning message:
In system("/usr/libexec/java_home", intern = TRUE) :
running command '/usr/libexec/java_home' had status 1
No Java runtime present, try --request to install.
Thank you, I tried entering that command in R but got the following error. I wasn't sure what you meant by system terminal - is there a location on a Mac where you mean I should be entering that?
sudo R CMD javareconf
Error: unexpected symbol in "sudo R"
I do have Java, I just checked it, updated to the latest version and restarted the computer.
I then opened R and retried opening xlsx and got the following error message again:
library(xlsx)
Error: package or namespace load failed for ‘xlsx’:
.onLoad failed in loadNamespace() for 'rJava', details:
call: dyn.load(file, DLLpath = DLLpath, ...)
error: unable to load shared object '/Library/Frameworks/R.framework/Versions/3.6/Resources/library/rJava/libs/rJava.so':
dlopen(/Library/Frameworks/R.framework/Versions/3.6/Resources/library/rJava/libs/rJava.so, 6): Library not loaded: /Library/Java/JavaVirtualMachines/jdk-11.0.1.jdk/Contents/Home/lib/server/libjvm.dylib
Referenced from: /Library/Frameworks/R.framework/Versions/3.6/Resources/library/rJava/libs/rJava.so
Reason: image not found
In addition: Warning message:
In system("/usr/libexec/java_home", intern = TRUE) :
running command '/usr/libexec/java_home' had status 1
Unable to find any JVMs matching version "(null)".
No Java runtime present, try --request to install.