1

So I tried everything I found online but with no luck. I am trying to use qdab library that requires rJava.

So I install rJava, try to run library("rJava") and get

> library("rJava")
Error : .onLoad failed in loadNamespace() for 'rJava', details:
  call: fun(libname, pkgname)
  error: JAVA_HOME cannot be determined from the Registry
Error: package or namespace load failed for ‘rJava’

Then I tried to add path manually, by Sys.setenv and that's what's happening:

> Sys.setenv(JAVA_HOME="C:\\Program Files (x86)\\Java\\jre1.8.0_31")
> library("rJava")

Error : .onLoad failed in loadNamespace() for 'rJava', details:
  call: inDL(x, as.logical(local), as.logical(now), ...)
  error: unable to load shared object 'D:/Moje Dokumenty/R/win-library/3.1/rJava/libs/x64/rJava.dll':
  LoadLibrary failure:  %1 nie jest prawidłową aplikacją systemu Win32.

Error: package or namespace load failed for ‘rJava’

I reinstalled java, tried few other solutions but that should do it and it didn't. What else can I do ?

2
  • is JAVA_HOME in your path?
    – BBrill
    Commented Feb 5, 2015 at 18:05
  • I added JAVA_HOME to my local paths in windows still no luck Commented Feb 5, 2015 at 18:26

2 Answers 2

2

Ok I solved it by installing 64bit Java and clearing JAVA_HOME in R using:

if (Sys.getenv("JAVA_HOME")!="")
  Sys.setenv(JAVA_HOME="")
library(rJava)
1

I had the same problem until I installed the 64-bit version of Java. You have to manually download the 64-bit version. The default installer is the 32-bit version.

Follow this link to the manual download page:

http://www.java.com/en/download/manual.jsp

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.