我正在尝试在Mac上安装rJava
,但收到以下错误消息:
[...]
checking whether javah was replaced by javac -h... no
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 ‘/usr/local/lib/R/3.6/site-library/rJava’
Warning in install.packages :
installation of package ‘rJava’ had non-zero exit status
但是,我有java
和javac
,所以我没有仅拥有一个JRE:
$ java -version
openjdk version "1.8.0_242"
OpenJDK Runtime Environment (AdoptOpenJDK)(build 1.8.0_242-b08)
OpenJDK 64-Bit Server VM (AdoptOpenJDK)(build 25.242-b08, mixed mode)
$ javac -version
javac 1.8.0_242
但是我有点被线打扰了
JAVA_HOME : /Library/Java/JavaVirtualMachines/adoptopenjdk-8.jdk/Contents/Home/jre
在R CMD javareconf
中。因为它以jre结尾。那是我的问题吗?
我做了一些谷歌搜索,但没有发现太多。例如,对https://github.com/s-u/rJava/issues/146的最后评论没有希望。
我该如何才能运行rJava
?
从https://www.oracle.com/java/technologies/javase-jdk8-downloads.html下载并安装jdk-8u251-macosx-x64.dmg,>
setup JAVA_HOME
正如错误所暗示的,它正在寻找JRE
作为您的JAVA_HOME
。只需将JAVA_HOME
指向JDK,就像这样: