0

I've looked through a lot of rJava issues and tried a lot of things (the ones I could understand at least). I updated to R 3.5 yesterday and my rJava/xlsx packages can't seem to work. The install doesn't show any errors, but when I try to load it in with library, I get the following error:

> Error: package or namespace load failed for ‘rJava’:  .onLoad failed
> in loadNamespace() for 'rJava', details:   call: dyn.load(file,
> DLLpath = DLLpath, ...)   error: unable to load shared object
> '/Library/Frameworks/R.framework/Versions/3.5/Resources/library/rJava/libs/rJava.so':
> dlopen(/Library/Frameworks/R.framework/Versions/3.5/Resources/library/rJava/libs/rJava.so,
> 6): Library not loaded:
> /Library/Java/JavaVirtualMachines/jdk-9.jdk/Contents/Home/lib/server/libjvm.dylib
> Referenced from:
> /Library/Frameworks/R.framework/Versions/3.5/Resources/library/rJava/libs/rJava.so
> Reason: image not found

The .so file does exist in the spot it seems to be looking . . . I've tried doing the sudo R CMD javareconf in Terminal, but no luck. JAVA_HOME is shown as /Library/Java/JavaVirtualMachines/jdk1.8.0_181.jdk/Contents/Home/jre. I'm on a Macbook with High Sierra 10.13.4.

Followed the instructions in the recommended post, but it seems to have led to RStudio launching with R 3.4 rather than 3.5 which has it back to operational for me, but R 3.5 still does not load xlsx.

user3267547
  • 37
  • 1
  • 6
  • The most common reason this occurs is because you install a 64 bit (x64) version or R and have a 32 bit (x86) version of Java. By default Java will install a 32 bit version...in fact it is quite difficult to get the Java website to let you download a 64 bit version if you aren't paying attention. In R run `R.version` – Adam Sampson Jul 19 '18 at 19:36
  • I did read the referenced posting . . . maybe I'm just not understanding fully? – user3267547 Jul 19 '18 at 19:44
  • I had read that but couldn't seem to fully figure it out. Somehow that seems to have led to RStudio opening R 3.4 rather than 3.5 and that's why it's working. – user3267547 Jul 19 '18 at 19:53

0 Answers0