0
votes

When I want to install the xlsx package, I get this error :

Loading required package: rJava

Error : .onLoad failed in loadNamespace() for 'rJava', details: call: fun(libname, pkgname) error: JAVA_HOME cannot be determined from the Registry In addition: Warning message: package ‘rJava’ was built under R version 3.3.3 Error: package ‘rJava’ could not be loaded

So I tried reinstalling rJava, but I get this :

Error : .onLoad failed in loadNamespace() for 'rJava', details: call: fun(libname, pkgname) error: JAVA_HOME cannot be determined from the Registry In addition: Warning message: package ‘rJava’ was built under R version 3.3.3 Error: package or namespace load failed for ‘rJava’

Do you guys have any simple solution to this ? I am not very familiar with R, and I just need it to bootstrap some data.

1
not really an answer, but I overcame this by using openxslx(google.ch/…) instead. It offers the same functionalities without having Java as a dependency.hartmut
Else, could you tell us whether you use r 32 or 64 bits? And the same for java? I think the problem could be related to using e.g., R 64 and Java 32.hartmut

1 Answers

0
votes

I had the same error recently (R Error: JAVA_HOME cannot be determined from the Registry). I found the solution here. In brief, Joachim Schork identified the problem as not the xlsx package but rather the rjava package. He explained that the problem usually is, as hartmut said, running a 64 bit version of R and a 32 bit version of Java. To resolve the problem according to his recommendation, you need to download and install the 64 bit version of Java. In my case, the solution included installing Java on my machine as it was never installed previously.