0

I've installed the rJava pack successfully. However, when I run the command library(rJava), I get the following error.

 > 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’

How can I solve this issue?

An old man in the sea.
  • 1,169
  • 1
  • 13
  • 30

1 Answers1

0

I had this problem running XLConnect as well. It turned out that my instance of R was unable to see the Jave Virtual Machine on my 64 bit Windows computer at work. I simply found the 64 bit version of my jvm.dll file in the folder where it lives.

You can just at the path to that .dll file to your library or require() function and it should undo the madness, although, in my case, I had to update Java completely because it was too old and set this at the beginning of my script to point to the JAVA home.

Sys.setenv(JAVA_HOME="yourpathhere")

See if that works.

sconfluentus
  • 4,693
  • 1
  • 21
  • 40