7

I have installed the latest versions of R (2.15.2) and Java (7.11), and through RStudio (0.97.310) I am trying to load the rJava package. It seemed to install properly, but when I call library(rJava) I get the following error:

 Error : .onLoad failed in loadNamespace() for 'rJava', details:
 call: stop("No CurrentVersion entry in '", key, "'! 
 Try re-installing Java and make sure R and Java have matching architectures.")
 error: object 'key' not found
 Error: package/namespace load failed for ‘rJava’

The documentation for rJava makes reference to Java 1.5+, so I am wondering if I need to install an ancient version of Java to resolve this problem. Any help would be much appreciated!

agstudy
  • 119,832
  • 17
  • 199
  • 261
user1996095
  • 131
  • 1
  • 5
  • 1
    Check out if you need for 64bit or 32. Your java type and R type need to match. See: http://java.com/en/download/faq/java_win64bit.xml – Tyler Rinker Jan 31 '13 at 17:41
  • Which version of java are you sung `system("java -version")`? – agstudy Jan 31 '13 at 17:53
  • This is almost a duplicate to the question I asked: http://stackoverflow.com/questions/10545458/rjava-warning-meaning but mine was more for compiling the package. In any event the issue is the same. – Tyler Rinker Jan 31 '13 at 18:10

2 Answers2

6

Ok, I figured it out. Guess I should have read the release notes on the rJava development website. I had installed Java, but not the JDK. Once I installed that, everything worked fine.

user1996095
  • 131
  • 1
  • 5
1

I had this problem and solved it by downloading and installing Java 64-bit (which you should probably choose if you have a modern computer) from the Java download site.

ktdrv
  • 3,602
  • 3
  • 30
  • 45