rJava从哪里获取JDK的位置?

时间:2017-04-20 19:15:12

标签: r rjava

rJava从哪里获取JDK的位置?我设置了JAVA_HOME,但在install.packages("rJava")我得到了这个

checking Java support in R... present:
interpreter : '/usr/lib/jvm/default-java/jre/bin/java'
archiver    : '/usr/lib/jvm/default-java/bin/jar'
compiler    : '/usr/lib/jvm/default-java/bin/javac'
header prep.: '/usr/lib/jvm/default-java/bin/javah'
cpp flags   : '-I/usr/lib/jvm/default-java/include -I/usr/lib/jvm/default-java/include/linux'
java libs   : '-L/usr/lib/jvm/default-java/jre/lib/amd64/server -ljvm'
checking whether Java run-time works... 
./configure: line 3736: /usr/lib/jvm/default-java/jre/bin/java: No such file or directory
no
configure: error: Java interpreter '/usr/lib/jvm/default-java/jre/bin/java' does not work
ERROR: configuration failed for package ‘rJava’

我无法弄清/usr/lib/jvm/default-java/来自哪里。

1 个答案:

答案 0 :(得分:2)

从配置时存储它的R:

edd@max:~$ grep ^JAVA /etc/R/Makeconf 
JAVA = /usr/lib/jvm/default-java/jre/bin/java
JAVAC = /usr/lib/jvm/default-java/bin/javac
JAVAH = /usr/lib/jvm/default-java/bin/javah
JAVA_HOME = /usr/lib/jvm/default-java
JAVA_CPPFLAGS = -I$(JAVA_HOME)/include -I$(JAVA_HOME)/include/linux
JAVA_LIBS = -L$(JAVA_HOME)/jre/lib/amd64/server -ljvm
JAVA_LD_LIBRARY_PATH = $(JAVA_HOME)/jre/lib/amd64/server
edd@max:~$ 

如果您更新Java工具链,可以通过R CMD javareconf更新此工具。