首先我卸载了ubuntu原先的openjdk,然后重新安装了sun的jdk,完成后运行
java -version
得到:
java version "1.6.0_25"
Java(TM) SE Runtime Environment (build 1.6.0_25-b06)
Java HotSpot(TM) Server VM (build 20.0-b11, mixed mode)
说明已经安装成功且环境变量设置正确。
但是以root用户运行R CMD javareconf
却得到:
*** Cannot find any Java interpreter
*** Please make sure 'java' is on your PATH or set JAVA_HOME correspondingly
在安装rjava时出现这个信息:
checking Java support in R... present:
interpreter : '/usr/bin/java'
archiver : '/usr/bin/jar'
compiler : '/usr/bin/javac'
header prep.: '/usr/bin/javah'
cpp flags : '-I/usr/lib/jvm/java-6-openjdk/jre/../include'
java libs : '-L/usr/lib/jvm/java-6-openjdk/jre/lib/i386/server -ljvm'
checking whether Java run-time works... ./configure: line 3729: /usr/bin/java: No such file or directory
no
configure: error: Java interpreter '/usr/bin/java' does not work
ERROR: configuration failed for package ‘rJava’
* removing ‘/home/cyril/R/i486-pc-linux-gnu-library/3.1/rJava’
加粗部分显示的java路径都是错的,而且竟然还出现了已经卸载的java-6-openjdk
应该怎么解决呢