Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Compiling rJava macOS, java8 #153
I am having trouble when compiling rJava (0.9-10) from source. I am using macOS highSierra 10.13.5 and JDK 1.8.0_172. I have found that it is related to the issue #151. I have the latest version of R (3.5.0), and I have used "R CMD javareconf" to detect the current java setup and update the configuration in R, every thing seems normal, but when I try to install the package, using "R CMD install rJava", the configuration scripts indicates that "JDK is incomplete".
Below you can see the output from javareconf and the attempt to install the package
$sudo R CMD javareconf
trying to compile and link a JNI program
JAVA_HOME : /Library/Java/JavaVirtualMachines/jdk1.8.0_172.jdk/Contents/Home/jre
$R CMD INSTALL rJava
=== configuring in jri (/Users/<your_user>/Downloads/rJava/jri)
*** JDK is incomplete! Please make sure you have a complete JDK. JRE is not sufficient.
I have install jdk from oracle and I do not have any other jdk/jre installed.
This message could be related to the code in lines 118-124 and 145 in the file jri/configure.ac,
If I execute in the console:
but if I execute
Sorry for the long report, I hope it helps.
Attached the config.log
I downloaded rJava 0.9-9 almost at the end of the compilation process it gives an error that indicates that openmp is not supported by the compiler. I am using the last version of Xcode (9.4, 9F1027a), perhaps is a problem with clang, I have compiled rJava 0.9-9 before and it was working.
Below the relevant output generated when trying to compile version 0.9-9
clang -o libjri.jnilib Rengine.o jri.o Rcallbacks.o Rinit.o globals.o rjava.o -dynamiclib -framework JavaVM -fopenmp -L/usr/local/lib -F/Library/Frameworks/R.framework/.. -framework R -lpcre -llzma -lbz2 -lz -licucore -lm -liconv
Below the output from clang --version
$ clang --version
Best regards and thanks for the attention.
@perpdgo your issue with rJava 0.9-9 has nothing to do with rJava - you just don't have the correct compilers to use with R. You have to use the clang compiler from the CRAN pages since Apple's compilers are lacking OpenMP support (see the main CRAN download page).
As for rJava 0.9-10, I'll have to see why
Can any one of you can share the file in ~/.R/Makevars?
I have installed clang6 from gcc, but still unable to compile r-java 0.9-9,
here the contents of my file
#F77 = /usr/local/bin/gfortran
when I try to install the package I obtain the following:
ld: unexpected token: !tapi-tbd-v3 file '/System/Library/Frameworks//CoreFoundation.framework/CoreFoundation.tbd' for architecture x86_64
Hi have solved the issue, here are the steps that allow me to install successfully r-java 0.9-9 from source
Hi @perpdgo @s-u @pascaloettli , I also have this issue, I just can't install rJava and I've been trying to solve it for 2 days now, I've been using r-java 0.9-10, but I can't quite figure out how to install the 0.9-9 version from terminal,
Also yeah, my R is in Japanese for some reason and I don't know how to change it to english.
I have to say I'm a beginner so when you say this I'm kind of lost, I'm almost sure I've done some of that while trying to solve this issue with other threads but I'm not 100% sure and I don't want to mess something up, please could you or anyone else reading this tell me what commands I should use?
Thank you @pascaloettli, now I just got a different error, again, no idea why this is happening but I'm trying to fix it, I'll look for what the issue is but if you or anyone else have an idea let me know.
referenced this issue
Jul 12, 2018
Then reinstall will get this
As the error message, javah is not in that place, javah is in /usr/bin, I don't know why it can't be found.
@s-u This information helps you check why javah from Java 1.8 on macOS doesnt' get recognized as working ?
I ran into the same problem and found that on macOS Mojave (and maybe High Sierra?) the Mac OS headers have to be manually installed. Link to my solution on SO with notes on how I solved it.
For completeness here, install the macOS SDK package file using terminal
After this, in the terminal, configure rJava and install as in the previous answer
Running High Sierra here, I got the same error message.
This worked for me: