Waichler, Scott R
2012-Apr-12 20:41 UTC
[R] Can't get R to recognize Java for rJava installation
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
Milan Bouchet-Valat
2012-Apr-13 09:37 UTC
[R] Can't get R to recognize Java for rJava installation
Le jeudi 12 avril 2012 ? 13:41 -0700, Waichler, Scott R a ?crit :> 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?It looks like you need "Java headers gen." to be set. Here on my box (Fedora 16) it is: Java headers gen.: /usr/bin/javah So I guess you need to find out what package provides this file on your distribution (which you did not mention). First check the file is currently not present. Cheers