Error:Cannot compile a simple JNI program
Asked Answered
T

2

8

When I tried to run r console in eclipse,got this error:

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

So I tried to intall in R console like this:

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

got this error:

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’

by the way,my configuration is:ubntu 11.10 64bit+eclipse 3.7,and I have followed this post: http://www.twm-kd.com/linux/install-oracle-java-sdk-in-ubuntu-11-10/ to install oracle-1.7.0-jdk,then run: "sudo R CMD javareconf",got:

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.

session info

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 
Trappist answered 12/10, 2012 at 14:40 Comment(1)
Works for me. Can you post your sessionInfo()?Intermediacy
K
9

Did you make sure you do sudo R CMD javareconf before you do install.packages(c("rj", "rj.gd"), repos="http://download.walware.de/rj-1.1")?

Kellerman answered 12/7, 2014 at 4:15 Comment(3)
Just realized this is a 1 year old post.:| anyhow good if it helps others.Kellerman
It is helpful. I have this problem when installing xlsx with R version 3.5.3 (2019-03-11) Rstudio Version 1.2.1335. ~~~~~~ text checking whether JNI programs can be compiled... configure: error: Cannot compile a simple JNI program. See config.log for details. Make sure you have Java Development Kit installed and correctly registered in R. If in doubt, re-run "R CMD javareconf" as root. ~~~~~~There is a terminal option in Rstudio. Just run R CMD javareconf as root. Then re-install the package.Dally
And the Rstudio should be restarted. Then everything works fine.Dally
T
0

Removing current version 2.13,then install new version 2.15,this problem gone.

Trappist answered 13/10, 2012 at 11:25 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.