0

I am trying to get RJava to work.

I have downloaded the 64-bit Java and tried to manually set where to find my java within R Studio.

I keep on getting this 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.4/Resources/library/rJava/libs/rJava.so':
  dlopen(/Library/Frameworks/R.framework/Versions/3.4/Resources/library/rJava/libs/rJava.so, 6): Library not loaded: @rpath/libjvm.dylib
  Referenced from: /Library/Frameworks/R.framework/Versions/3.4/Resources/library/rJava/libs/rJava.so
  Reason: image not found

Any responses will be apreciated

1
  • Just look here: owsiak.org/?p=3671 - it's quite detailed description how to deal with rJava, R and JDK in macOS.
    – Oo.oO
    Commented Jul 7, 2017 at 1:54

1 Answer 1

1

Take a look at the location here: R, Java, rJava and macOS adventures

You can find there description of how to deal with Java, R, rJava inside macOS. There is some mess, generally, there. You have to pay attention to few things like:

  • location of JDK,
  • making sure R points to proper libs,
  • making sure you are using Oracle's based JDK.

Eventually, you should get it running once setting all the stuff in place.

I don't post full description here as it's quite long. Also, pay attention to JDK settings that allow to run JNI based codes. You need to make sure that JDK has proper settings inside

`/usr/libexec/java_home`/../Info.plist

Lots of things to be done, but eventually, it should work :)

Have fun with R.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.