3
votes

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.

1
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
Also try changing CRAN mirror.mysteRious

1 Answers

0
votes

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