sudo R CMD javareconf
Java interpreter : /usr/lib/jvm/default-java/jre/bin/java
Java version : 1.8.0_121
Java home path : /usr/lib/jvm/default-java
Java compiler : not present
Java headers gen.:
Java archive tool:
trying to compile and link a JNI program
detected JNI cpp flags :
detected JNI linker flags : -L$(JAVA_HOME)/jre/lib/amd64/server -ljvm
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG -fpic -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c conftest.c -o conftest.o
conftest.c:1:17: fatal error: jni.h: 没有那个文件或目录
compilation terminated.
/usr/lib/R/etc/Makeconf:159: recipe for target 'conftest.o' failed
make: *** [conftest.o] Error 1
Unable to compile a JNI program
JAVA_HOME : /usr/lib/jvm/default-java
Java library path:
JNI cpp flags :
JNI linker flags :
Updating Java configuration in /usr/lib/R
Done.
当我运行sudo R CMD javareconf时,结果告诉我找不到jni.h。我安装了Java和Hadoop,我想安装R包'rJava'。但是当我安装'rJava'并且Rstudio也运行error.First时,我想知道如何解决sudo R CMD javareconf并找到jni.h文件
答案 0 :(得分:6)
编译器标志表明您使用的是Debian或Ubuntu。然后,您可以使用R包本身用于其构建的内容:
sudo apt-get install default-jdk
键是" jdk" - 开发套件,而不仅仅是" jre"又称运行时环境。
但如果您只想要rJava包,请尝试
sudo apt-get install r-cran-rjava
答案 1 :(得分:0)