3

I am running RSTudio Version 1.1.442 and R3.5. When I try to load rJava I get the following error;

library(rJava) 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: no suitable image found. Did find: /Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Libraries/libjvm.dylib: mach-o, but wrong architecture /Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Libraries/libclient.dylib: mach-o, but wrong architecture

I have tried uninstalling and reinstalling Java and have run the terminal command R CMD javareconf without success.

Thanks for your help.

  • After unistalling and reinstalling Java did you uninstall and reinstall rJava? Also you might want to check the 32bit/ 64bit of your machine and Java (if that applies). I would uninstall both then install Java then rJava. – Mike Jun 21 '18 at 19:32
  • Also try changing CRAN mirror. – mysteRious Jun 22 '18 at 00:05

1 Answers1

0

Thanks for the suggestions. A second réinstallation of Java did the trick.

  • 1
    In your question, you say that you've tried uninstalling reinstalling Java and the problem is unresolved. In your comments, you say that "a second reinstallation of Java did the trick." Please include link, and explain. – Nettle Aug 11 '18 at 17:06