Unable to install rjava in macbook pro 64-bit - java

I am trying to run the JDBC package. however, that requires that I install the rjava package. when i install rjava library, i get the following error:
library(rJava)
Unable to find any JVMs matching version "(null)".
No Java runtime present, try --request to install.
Error: package or namespace load failed for ‘rJava’:
.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

Related

How to install 'xlsx' in R

> library(**xlsx**)
Unable to find any JVMs matching version "(null)".
No Java runtime present, try --request to install.
Error: package or namespace load failed for ‘xlsx’:
.onLoad failed in loadNamespace() for 'rJava', details:
call: fun(libname, pkgname)
error: JVM could not be found
In addition: Warning messages:
1: In system("/usr/libexec/java_home", intern = TRUE) :
running command '/usr/libexec/java_home' had status 1
2: In fun(libname, pkgname) :
Cannot find JVM library 'NA/lib/server/libjvm.dylib'
Install Java and/or check JAVA_HOME (if in doubt, do NOT set it, it will be detected)
#then I tried 'writexlx' but then that began giving me error messages
>BiocManager::install('**writexslx**')
Bioconductor version 3.11 (BiocManager 1.30.10), R 4.0.2 (2020-06-22)
Installing package(s) 'writexslx'
Warning message:
package ‘writexslx’ is not available (for R version 4.0.2)
#I am not sure how to download this, please help
I evene tried to download jdk and that hasn't worked for me either.

Java issue with Rsentiment package

I'm working on sentiment analysis. I'm trying to use Rsentiment package in order to get the score for each sentence of my dataset. When I run the command I get a warning message related to an issue with Java. Does anyone of you have any suggestion? I run it on a Macbook. This is the message that I got:
Unable to find any JVMs matching version "(null)".
No Java runtime present, try --request to install.
Errore: package or namespace load failed for ‘rJava’:
.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.4/Resources/library/rJava/libs/rJava.so':
dlopen(/Library/Frameworks/R.framework/Versions/3.4/Resources/library/rJava/libs/rJava.so, 6): Library not loaded: #rpath/libjvm.dylib
Referenced from: /Library/Frameworks/R.framework/Versions/3.4/Resources/library/rJava/libs/rJava.so
Reason: image not found
Inoltre: Warning message:
running command '/usr/libexec/java_home' had status 1

RStudio not working in Mac OS Sierra 10.12.4

Hi and thanks in advance,
Don't know why but I get the following error message when trying to load a csv file in my RStudio desktop version that I have installed in my MAC:
Error: package or namespace load failed for 'rJava':
.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.4/Resources/library/rJava/libs/rJava.so':
dlopen(/Library/Frameworks/R.framework/Versions/3.4/Resources/library/rJava/libs/rJava.so, 6): Library not loaded: #rpath/libjvm.dylib
Referenced from: /Library/Frameworks/R.framework/Versions/3.4/Resources/library/rJava/libs/rJava.so
Reason: image not found
Could you please help me? I have tried downloading the latest version of Java, but does not work.
Thanks!

Why do I get "JNI_GetCreatedJavaVMs returned -1" error while loading the xlsx package in R?

I just downloaded xlsx package in R, but I just can't use the library. (On Mac)
> library(xlsx)
JavaVM: requested Java version ((null)) not available. Using Java at "" instead.
JavaVM: Failed to load JVM: /bundle/Libraries/libserver.dylib
JavaVM FATAL: Failed to load the jvm library.
Error : .onLoad failed in loadNamespace() for 'xlsx', details:
call: .jinit()
error: JNI_GetCreatedJavaVMs returned -1
Error: package or namespace load failed for ‘xlsx’
What am I doing wrong?
Make sure you have installed the dependencies:
xlsxjars
rJava
And, of course, if that does not work, verify you have the Java JDK installed in your mac: javac -version If not, just install it from here: https://java.com/en/download/faq/java_mac.xml

Rjava 64-bit error

I am receiving this error when I use packages XLConnect and rJava.
Loading required package: XLConnectJars
Error : .onLoad failed in loadNamespace() for 'rJava', details:
call: inDL(x, as.logical(local), as.logical(now), ...)
error: unable to load shared object 'C:/Program Files/R/R-3.2.2/library/rJava/libs/x64/rJava.dll':
LoadLibrary failure: %1 is not a valid Win32 application.
I have not seen this specific error in any threads here on in this community. Though I do believe the issue to be related to some other threads.
I have downloaded 64-bit java, and have tried to fix the path to java with:
Sys.setenv(JAVA_HOME='C:\Program Files\\Java\\jre1.8.0_65\\bin\\client\\jvm.dll')

Categories