[R] Can't get R to recognize Java for rJava installation
Milan Bouchet-Valat
nalimilan at club.fr
Fri Apr 13 11:37:56 CEST 2012
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
More information about the R-help
mailing list