- Notifications
You must be signed in to change notification settings - Fork 79
Description
Not sure this is a rJava problem but looking for help.
Installing R via homebrew gives me this message:
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` or `locate jni.h`) Bash completion has been installed to: /usr/local/etc/bash_completion.d running either (subbing jdk1.8.0_25.jdk for <version>) fails not finding jni.h
java installs jni.h into
/Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk/Contents/Home/include Since there was nothing at /System/Library/Frameworks/JavaVM.framework/Headers/ where javareconf seems to want to look for it, I created symlinks:
cd /System/Library/Frameworks/JavaVM.framework/Versions sudo ln -nsf /Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk/Contents ./CurrentJDK cd /System/Library/Frameworks/JavaVM.framework sudo ln -nsf Versions/CurrentJDK/Home/include/ ./Headers and added
export JAVA_HOME = "/Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk/Contents/Home" to ~/.bash_profile since without it javareconf says the JAVA_HOME is not a valid path. This allows javareconf to find jni.h using:
R CMD javareconf JAVA_CPPFLAGS=-I/System/Library/Frameworks/JavaVM.framework/Headers -I/System/Library/Frameworks/JavaVM.framework/Headers/ but then javareconf fails because it can't find jni_md.h which is in /Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk/Contents/Home/include/dawrin
looking at javareconf there is this code:
## only if we get jni.h we can try to find jni_md.h if test -n "${jinc}"; then JAVA_CPPFLAGS="-I${jinc}" jmdinc='' jmdirs='' ## we are not in configure, so we need to find the OS from R host_os=`echo 'cat(R.version$os)'|${R_HOME}/bin/R --vanilla --slave 2>/dev/null` ## put the most probable locations for each system in the first place case "${host_os}" in darwin*) jmdirs=darwin;; linux*) jmdirs=linux;; bsdi*) jmdirs=bsdos;; osf*) jmdirs=alpha;; solaris*) jmdirs=solaris;; freebsd*) jmdirs=freebsd; add_java_libs='-lpthread';; esac I would think that this would allow javareconf to find the jni_md.h but that's not happening.
This may not be a rJava issue but since the R install said to run javareconf in order to enable rJava support, I thought I would post here, but then again, I know just enough to know that I know nothing about this stuff. I'm just bummed I can't get rJava installed in R.
Thanks for taking the time to read this.