Skip to content

Instantly share code, notes, and snippets.

@tengpeng
Created October 31, 2016 15:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tengpeng/4319863d16e296f8b8d2929a92019ddf to your computer and use it in GitHub Desktop.
Save tengpeng/4319863d16e296f8b8d2929a92019ddf to your computer and use it in GitHub Desktop.
set up rJava on Mac
To enable rJava support, run the following command:
R CMD javareconf JAVA_CPPFLAGS=-I/System/Library/Frameworks/JavaVM.framework/Headers
If you've installed a version of Java other than the default, you might need to instead use:
R CMD javareconf JAVA_CPPFLAGS="-I/System/Library/Frameworks/JavaVM.framework/Headers -I/Library/Java/JavaVirtualMachines/jdk<version>.jdk/"
(where <version> can be found by running `java -version`, `/usr/libexec/java_home`, or `locate jni.h`), or:
R CMD javareconf JAVA_CPPFLAGS="-I/System/Library/Frameworks/JavaVM.framework/Headers -I$(/usr/libexec/java_home | grep -o '.*jdk')"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment