I'm trying to install 'rJava' package on my RStudio. But it gives me this error:
configure: error: one or more Java tools are missing.
*** JDK is incomplete! Please make sure you have a complete JDK. JRE is *not* sufficient.
configure: error: ./configure failed for jri
ERROR: configuration failed for package ‘rJava’
* removing ‘/Users/art/Library/R/3.4/library/rJava’
* restoring previous ‘/Users/art/Library/R/3.4/library/rJava’
Warning in install.packages :
installation of package ‘rJava’ had non-zero exit status
When I try to install on R, it gives me:
checking whether JNI programs run... configure: error: Unable to run a simple JNI program. Make sure you have configured R with Java support (see R documentation) and check config.log for failure reason.
ERROR: configuration failed for package ‘rJava’
* removing ‘/Users/art/Library/R/3.4/library/rJava’
* restoring previous ‘/Users/art/Library/R/3.4/library/rJava’
An old solution : sudo R CMD javareconf
used to work for me but not any more.
This is what it gives:
Java interpreter : /usr/bin/java
Java version : 1.8.0_252
Java home path : /Library/Java/JavaVirtualMachines/zulu-8.jdk/Contents/Home/jre
Java compiler : /usr/bin/javac
Java headers gen.: /usr/bin/javah
Java archive tool: /usr/bin/jar
Non-system Java on macOS
trying to compile and link a JNI program
detected JNI cpp flags : -I$(JAVA_HOME)/../include -I$(JAVA_HOME)/../include/darwin
detected JNI linker flags : -L$(JAVA_HOME)/lib/server -ljvm
clang -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I/Library/Java/JavaVirtualMachines/zulu-8.jdk/Contents/Home/jre/../include -I/Library/Java/JavaVirtualMachines/zulu-8.jdk/Contents/Home/jre/../include/darwin -I/usr/local/include -fPIC -Wall -g -O2 -c conftest.c -o conftest.o
clang -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -single_module -multiply_defined suppress -L/Library/Frameworks/R.framework/Resources/lib -L/usr/local/lib -o conftest.so conftest.o -L/Library/Java/JavaVirtualMachines/zulu-8.jdk/Contents/Home/jre/lib/server -ljvm -F/Library/Frameworks/R.framework/.. -framework R -Wl,-framework -Wl,CoreFoundation
JAVA_HOME : /Library/Java/JavaVirtualMachines/zulu-8.jdk/Contents/Home/jre
Java library path: $(JAVA_HOME)/lib/server
JNI cpp flags : -I$(JAVA_HOME)/../include -I$(JAVA_HOME)/../include/darwin
JNI linker flags : -L$(JAVA_HOME)/lib/server -ljvm
Updating Java configuration in /Library/Frameworks/R.framework/Resources
Done.
java -version
gives:
openjdk version "1.8.0_252"
OpenJDK Runtime Environment (Zulu 8.46.0.20-SA-macosx) (build 1.8.0_252-b14)
OpenJDK 64-Bit Server VM (Zulu 8.46.0.20-SA-macosx) (build 25.252-b14, mixed mode)
My system is MacOS Mojave 10.14.6, could anyone please help me with this issue? Thank you!