1

I cannot use R with Java on the Mac. There is a wealth of information on the web, including on Stack Overflow (e.g. rJava load error in RStudio/R after "upgrading" to OSX Yosemite), but none of this helps me. The standard advice is to find the file libjvm.dylib, and to set up a link to this as follows;

sudo ln -f -s $(/usr/libexec/java_home)/jre/lib/server/libjvm.dylib /usr/local/lib

The problem is that I do not have the file libjvm.dylib anywhere on my system, despite repeatedly downloading the latest version of Java from Oracle.

My Java home is as follows; /Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home.

The Java version is; java version "1.6.0_65" Java(TM) SE Runtime Environment (build 1.6.0_65-b14-468-11M4833) Java HotSpot(TM) 64-Bit Server VM (build 20.65-b04-468, mixed mode).

The tree structure of my java home (directories only) is;

enter image description here

It looks completely different from the tree structure which I'm supposed to have, e.g. there is no 'jre' folder.

Thanks in advance.

Nick Riches
  • 317
  • 2
  • 13

1 Answers1

1

You don't have to make symbolic links etc. You simply need to properly configure Java and R to get them running smooth.

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

Recently, I have updated this entry for more recent R - R 3.4. Take a look here: R 3.4, rJava, macOS and even more mess ;)

Maybe this time it will help ;)

Oo.oO
  • 12,464
  • 3
  • 23
  • 45
  • Thanks, I followed your advice, but I still get the following 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 – Nick Riches Jul 31 '17 at 16:31
  • My problem is sorted. I reloaded Java 8, and the relevant files (libvjm.dylib and rJava.so) have appeared. I do not know what I did wrong previously. Thanks for help. – Nick Riches Aug 23 '17 at 10:27
  • .oOo. Cool! Thanks for accepting the solution .oOo. – Oo.oO Aug 23 '17 at 10:33