Skip to content
Prev 30469 / 63424 Next

problems installing rJava with R-2.8.0

Hello Christian,

I had the same problem with running install.packages("rJava"), exactly
the same error as you. Turned out the solution was changing a 7 into a
6 somewhere ... please allow me to explain :)

Of course the first thing I did, and I suppose you did is follow the
advice of Simon Urbanek, run "R CMD javareconf" as root, or if that
doesn't work "R CMD javareconf -ed". This is the output of that:
===============
linux:/usr/lib/jvm # R CMD javareconf -ed
*** JAVA_HOME is not a valid path, ignoring
Java interpreter : /usr/bin/java
Java version     : 1.6.0_06
Java home path   : /usr/lib/jvm/java-1.6.0-sun-1.6.0.u6/jre
Java compiler    : /usr/bin/javac
Java headers gen.: /usr/bin/javah
Java archive tool: /usr/bin/jar
Java library path:
$(JAVA_HOME)/lib/i386/server:$(JAVA_HOME)/lib/i386:$(JAVA_HOME)/../lib/i386::/usr/java/packages/lib/i386:/lib:/usr/lib
JNI linker flags : -L$(JAVA_HOME)/lib/i386/server
-L$(JAVA_HOME)/lib/i386 -L$(JAVA_HOME)/../lib/i386 -L
-L/usr/java/packages/lib/i386 -L/lib -L/usr/lib -ljvm
JNI cpp flags    : -I$(JAVA_HOME)/../include -I$(JAVA_HOME)/../include/linux

Updating Java configuration in /usr/lib/R
Done.
===============
Done. That means "everything is ok" ... right? No. Look at the first
line ... "*** JAVA_HOME is not a valid path, ignoring".
I figured that's odd, I had no trouble running "java" or "javac" on my
computer ... so I ran "$JAVA_HOME"
===============
linux:/usr/lib/jvm # $JAVA_HOME
bash: /usr/lib/jvm/java-1.6.0-sun-1.6.0.u7: No such file or directory
===============
Strange, that seemed to be the correct path ... but upon closer
inspection I realized I didn't have update 7 but update 6, so the
correct path would be "/usr/lib/jvm/java-1.6.0-sun-1.6.0.u6". I used
to have 7 (downloaded from the Sun website) but removed it and
installed the version from the openSUSE repositories instead, I guess
somehow JAVA_HOME was not updated, even after running
"update-alternatives --config javac". Exporing JAVA_HOME manually did
the trick for me, so running as root:
export JAVA_HOME=/usr/lib/jvm/java-1.6.0-sun-1.6.0.u6
Then running "R CMD javareconf " worked without warning this time. And
then running R and "install.package("rJava")" worked without trouble.

Still I'm curious where that magical config.log file is located,
perhaps that would have pointed out my mistake right away.

Best,

Joris

On Wed, Oct 29, 2008 at 17:10, Simon Urbanek
<simon.urbanek at r-project.org> wrote: