Error: package ‘XLConnectJars’ could not be loaded in mac os - java

I got a problem when I called 'XLConnect' library in R.
Loading required package: XLConnectJars 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
'XLConnectJars', details: call: .jinit() error:
JNI_GetCreatedJavaVMs returned -1
Error: package ‘XLConnectJars’ could not be loaded
This error happened after I installed XLConnect and wrote library(XLconnect).
I googled this problem but there are no proper solution in my case.
I have already installed Java 8 and checked java location in terminal.
I run R in mac OS X (10.10.5)
Thank you for your help.

I solve the problem thanks to http://www.r-bloggers.com/getting-r-and-java-1-8-to-work-together-on-osx/

Related

Problems with installing rJava package

I have tried to call the library xlsx, since I want to save data in multiple-sheets excel files, but I got a Java-related error. Even when I run library(rJava) I have this error code:
Error: package or namespace load failed for ‘rJava’:
.onLoad failed in loadNamespace() for 'rJava', details:
call: inDL(x, as.logical(local), as.logical(now), ...)
error: unable to load shared object 'C:/Users/me/Documents/R/win-library/4.0/rJava/libs/x64/rJava.dll':
LoadLibrary failure: The specified module could not be found.
The solutions I have found online are quite old and none helped to solve the issue: I have tried to reinstall Java 64 bit on my OS (Windows 10-64bit), and the package rJava, I have tried to set Java home with Sys.setenv(JAVA_HOME="C:\Program Files\Java\jre1.8.0_271\") without success. I use R 64 bit.
Do you have any suggestions?
Finally, the solution reported here worked for me. The most important thing is to download the offline version of Java

Cant download package xlsx or rjava R

I am trying to download the xlsx package in R but get the following error message:
Error: package or namespace load failed for 'xlsx':
.onLoad failed in loadNamespace() for 'rJava', details:
call: fun(libname, pkgname)
error: No CurrentVersion entry in Software/JavaSoft registry! Try re-installing Java and make sure R and Java have matching architectures.
Error: loading failed
Execution halted
*** arch - x64
ERROR: loading failed for 'i386'
* removing 'C:/Users/X/Documents/R/win-library/3.6/xlsx'
Warning in install.packages :
installation of package ‘xlsx’ had non-zero exit status
I have also tried to download rjava, but get this error message:
ERROR*> JavaSoft\{JRE|JDK} can't open registry keys.
ERROR: cannot find Java Development Kit.
Please set JAVA_HOME to specify its location manually
ERROR: configuration failed for package 'rJava'
* removing 'C:/Users/X/Documents/R/win-library/3.6/rJava'
* restoring previous 'C:/Users/X/Documents/R/win-library/3.6/rJava'
Warning in install.packages :
installation of package ‘rJava’ had non-zero exit status
I have reinstalled Java to my computer, with the same architecture s my computer and R (64-bit), which most of the help online says that I should try out. Have anyone experienced the same problem?

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