[英]Installing `rJava` on MacOSX fails with “JDK is incomplete!…”
I am trying to install rJava
on my Mac but I get the following error message:我正在尝试在我的 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
However, I have java
and javac
so I don't simply have a JRE:但是,我有
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
I am however slightly bothered by the line然而,我对这条线有点困扰
JAVA_HOME : /Library/Java/JavaVirtualMachines/adoptopenjdk-8.jdk/Contents/Home/jre
in R CMD javareconf
.在
R CMD javareconf
。 Because it ends with jre.因为它以jre结尾。 Is that part of my problem?
那是我问题的一部分吗?
I have done some googling but I have not found much.我做了一些谷歌搜索,但我没有找到太多。 For example the last comment on https://github.com/su/rJava/issues/146 is not promising.
例如,关于https://github.com/su/rJava/issues/146的最后一条评论并不乐观。
What should I do to be able ro run rJava
?我应该怎么做才能运行
rJava
?
As the error suggests, it is finding the JRE
as your JAVA_HOME
.正如错误所暗示的,它发现
JRE
作为您的JAVA_HOME
。 Just set JAVA_HOME
to point to JDK, something like:只需将
JAVA_HOME
为指向 JDK,例如:
export JAVA_HOME=/Library/Java/JavaVirtualMachines/adoptopenjdk-8.jdk/Contents/Home/
Then try to install rJava
, if that is working you can add the export in your profile startup files.然后尝试安装
rJava
,如果可以,您可以在配置文件启动文件中添加导出。
Download and install jdk-8u251-macosx-x64.dmg from https://www.oracle.com/java/technologies/javase-jdk8-downloads.html从https://www.oracle.com/java/technologies/javase-jdk8-downloads.ZFC35EZ883A2268 下载并安装 jdk-8u251-macosx-x64.dmg
setup JAVA_HOME设置 JAVA_HOME
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.