简体   繁体   中英

Trying to install rJava but error says JDK is incomplete

I'm using install.packages('rJava', type='source') to install rJava, but it presents with the following 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 '/Library/Frameworks/R.framework/Versions/3.6/Resources/library/rJava' * restoring previous '/Library/Frameworks/R.framework/Versions/3.6/Resources/library/rJava'

Warning in install.packages : installation of package 'rJava' had non-zero exit status

I just installed JDK8 so I'm not sure what's going on. javac -version throws javac 1.8.0_231

java -version throws java version "1.8.0_231" Java(TM) SE Runtime Environment (build 1.8.0_231-b11) Java HotSpot(TM) 64-Bit Server VM (build 25.231-b11, mixed mode)

This guy at R: rJava package install failing came up with a solution that I don't even understand since I'm new to this, but it has something to do with PATH and JAVA_HOME and /jre apparently.

Looks like JAVA_HOME points to a JRE, not the JDK you want and need. Have a look at the top voted answer to "What should I set JAVA_HOME to on OS X". Also see https://developer.apple.com/library/archive/qa/qa1170/_index.html

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM