我在 centOS VM (cloudera cdh3u4) 上安装 rJava 时遇到问题。
我先这样做了:sudo R CMD javareconf
[cloudera@localhost ~]$ sudo R CMD javareconf
Java interpreter : /usr/bin/java
Java version : 1.6.0_31
Java home path : /usr/java/jdk1.6.0_31/jre
Java compiler : /usr/bin/javac
Java headers gen.:
Java archive tool: /usr/bin/jar
Java library path: $(JAVA_HOME)/lib/amd64/server:$(JAVA_HOME)/lib/amd64:$(JAVA_HOME)/../lib/amd64:/usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib
JNI linker flags : -L$(JAVA_HOME)/lib/amd64/server -L$(JAVA_HOME)/lib/amd64 -L$(JAVA_HOME)/../lib/amd64 -L/usr/java/packages/lib/amd64 -L/usr/lib64 -L/lib64 -L/lib -L/usr/lib -ljvm
JNI cpp flags : -I$(JAVA_HOME)/../include -I$(JAVA_HOME)/../include/linux
Updating Java configuration in /usr/lib64/R
Done.
但是当我想安装 rJava 时,我得到了这个:
> install.packages( c('rJava'),
+ repos='http://cran.revolutionanalytics.com')
...
configure: error: One or more Java configuration variables are not set.
Make sure R is configured with full Java support (including JDK). Run
R CMD javareconf
as root to add Java support to R.
If you don't have root privileges, run
R CMD javareconf -e
to set all Java-related variables and then install rJava.
ERROR: configuration failed for package ‘rJava’
* removing ‘/home/cloudera/R/x86_64-redhat-linux-gnu-library/2.15/rJava’
The downloaded source packages are in
‘/tmp/RtmpR5V6t5/downloaded_packages’
Warning message:
In install.packages(c("rJava"), repos = "http://cran.revolutionanalytics.com") :
installation of package ‘rJava’ had non-zero exit status
我不确定,但这是否意味着我需要安装 JDK?如果是,您是否知道一个好的站点,我可以在其中找到为我的案例安装正确 JDK 的分步信息?(我的最终目的是安装 rhdfs 和 rjava 是需要的依赖项)