8

当我尝试在 Eclipse 中运行 r 控制台时,出现此错误:

....Please make sure that R package 'rj' (1.1 or compatible) is installed...

所以我尝试像这样在 R 控制台中安装:

install.packages(c("rj", "rj.gd"), repos="http://download.walware.de/rj-1.1")

得到这个错误:

checking whether Java interpreter works... checking whether JNI programs can be compiled... configure: error:             Cannot compile a simple JNI program. See config.log for details.configure: error: ./configure failed for jri ERROR: configuration failed for package ‘rj’

顺便说一句,我的配置是:ubntu 11.10 64bit+eclipse 3.7,我已经关注了这个帖子:http ://www.twm-kd.com/linux/install-oracle-java-sdk-in-ubuntu-11- 10/安装oracle-1.7.0-jdk,然后运行:“sudo R CMD javareconf”,得到:

Java interpreter : /usr/bin/java
Java version     : 1.7.0
Java home path   : /usr/lib/jvm/java-7-oracle/jre
Java compiler    : /usr/bin/javac
Java headers gen.: /usr/bin/javah
Java archive tool: /usr/bin/jar
Java library path: :/usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib
JNI linker flags : -L -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 /etc/R
Done.

会话信息

R version 2.13.1 (2011-07-08)
Platform: x86_64-pc-linux-gnu (64-bit)

locale:
[1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C              
[3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8    
[5] LC_MONETARY=C              LC_MESSAGES=en_US.UTF-8   
[7] LC_PAPER=en_US.UTF-8       LC_NAME=C                 
[9] LC_ADDRESS=C               LC_TELEPHONE=C            
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base 
4

2 回答 2

9

你在做sudo R CMD javareconf 之前确定你做了install.packages(c("rj", "rj.gd"), repos="http://download.walware.de/rj-1.1")吗?

于 2014-07-12T04:15:12.763 回答
0

删除当前版本 2.13,然后安装新版本 2.15,这个问题就消失了。

于 2012-10-13T11:25:34.953 回答