2

I updated my Java version and deleted the older versions of Java. Now my XLConnect package will not load in R because XLConnectJars won't load. Here is the error message.

Loading required package: XLConnectJars
Error : .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: package ‘XLConnectJars’ could not be loaded

Is the only solution to reinstall an older version of Java?

qdread
  • 3,389
  • 19
  • 36
  • Does XLConnect work with Java8? Probably yes. Is the only solution to your problem to reinstall an older version. No. [Take a look at this answer about a very similar error message](http://stackoverflow.com/questions/9120270/how-can-i-install-rjava-for-use-with-64bit-r-on-a-64-bit-windows-computer/9120712#9120712) for more information. – nograpes Oct 24 '14 at 14:27
  • If you just changed your java version, make R aware of this by running `R CMD javareconf` from terminal. – nicola Oct 24 '14 at 14:51
  • Take a look here also: http://stackoverflow.com/questions/6492361/problem-loading-rjava/7604433#7604433 – lawyeR Oct 24 '14 at 15:06
  • Just to let any future people know who find this page, the error turned out to be caused by the bit architecture of R and of Java not matching (64-bit versus 32-bit). – qdread Oct 25 '14 at 21:25

2 Answers2

1

Try to define the path

options(java.home="C:/Program Files/Java/jre7/")

Change it appropriately

Romain
  • 839
  • 10
  • 24
1

What works for me in Windows 7 is:

options(java.home="C:\\Program Files\\Java\\jre1.8.0_45")
library(rJava)

after downloading the latest 64-bit Java version 8 from

http://java.com/en/download/manual.jsp
Hiraeth
  • 203
  • 2
  • 11