[R] Can't get R to recognize Java for rJava installation

Waichler, Scott R Scott.Waichler at pnnl.gov
Thu Apr 12 22:41:52 CEST 2012


Hi, I am unable to install the package rJava.  I tried doing what the output suggests, but it doesn't help.  How can I get R to find/recognize my Java installation?  I am running R-2.15.0.

waichler at snow> sudo R CMD javareconf
Java interpreter : /usr/bin/java
Java version     : 1.6.0_22
Java home path   : /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0/jre
Java compiler    : /usr/bin/javac
Java headers gen.:
Java archive tool: /usr/bin/jar
Java library path: $(JAVA_HOME)/lib/i386/client:$(JAVA_HOME)/lib/i386:$(JAVA_HOME)/../lib/i386:/usr/java/packages/lib/i386:/lib:/usr/lib
JNI linker flags : -L$(JAVA_HOME)/lib/i386/client -L$(JAVA_HOME)/lib/i386 -L$(JAVA_HOME)/../lib/i386 -L/usr/java/packages/lib/i386 -L/lib -L/usr/lib -ljvm
JNI cpp flags    :

Updating Java configuration in /usr/lib/R
Done.

> install.packages(c("rJava"), dependencies = T, repos = "http://cran.fhcrc.org")
. . . 
checking whether siglongjmp is declared... yes
checking Java support in R... present:
interpreter : '/usr/bin/java'
archiver    : '/usr/bin/jar'
compiler    : '/usr/bin/javac'
header prep.: ''
cpp flags   : ''
java libs   : '-L/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0/jre/lib/i386/client -L/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0/jre/lib/i386 -L/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0/jre/../lib/i386 -L/usr/java/packages/lib/i386 -L/lib -L/usr/lib -ljvm'
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 Æ/usr/lib/R/library/rJavaÇ

Thanks,
Scott Waichler
Senior Research Scientist
Hydrology Group, Energy & Environment Directorate
Pacific Northwest National Laboratory



More information about the R-help mailing list