[R-sig-Debian] R Java compile problem

Peter Muhlberger pmuhl1848 at gmail.com
Fri Jun 4 06:41:51 CEST 2010


Hi folks:  I'm trying to update my JGR and related packages, but run
into a compile problem, that I suspect must be affecting others.  I
get this output when compiling rJava, JavaGD, etc.:

##
checking Java support in R... present:
interpreter : '/usr/bin/java'
cpp flags   : ''
java libs   : '-L/usr/lib/jvm/java-6-openjdk/jre/lib/amd64/server
-L/usr/lib/jvm/java-6-openjdk/jre/lib/amd64
-L/usr/lib/jvm/java-6-openjdk/jre/../lib/amd64 -L
-L/usr/java/packages/lib/amd64 -L/usr/lib/jni -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.
##

When I run R CMD javareconf as root, I get:

##
# R CMD javareconf
*** JAVA_HOME is not a valid path, ignoring
Java interpreter : /usr/bin/java
Java version     : 1.6.0_0
Java home path   : /usr/lib/jvm/java-6-openjdk/jre
Java compiler    : /usr/bin/javac
Java headers gen.: /usr/bin/javah
Java archive tool: /usr/bin/jar
Java library path:
$(JAVA_HOME)/lib/amd64/server:$(JAVA_HOME)/lib/amd64:$(JAVA_HOME)/../lib/amd64::/usr/java/packages/lib/amd64:/usr/lib/jni:/lib:/usr/lib
JNI linker flags : -L$(JAVA_HOME)/lib/amd64/server
-L$(JAVA_HOME)/lib/amd64 -L$(JAVA_HOME)/../lib/amd64 -L
-L/usr/java/packages/lib/amd64 -L/usr/lib/jni -L/lib -L/usr/lib -ljvm
JNI cpp flags    :

Updating Java configuration in /etc/R
Done.
##

When I investigate JAVA_HOME, I get:

##
# echo $JAVA_HOME
/usr/lib/jvm/java-6-sun
# ls /usr/lib/jvm/java-6-sun
bin        docs  include  lib      man          THIRDPARTYLICENSEREADME.txt
COPYRIGHT  ext   jre      LICENSE  README.html
##

So, JAVA_HOME does point to a proper installation of Sun's Java, so
far as I can tell.  The cpp flag seems to be the big problem, but I
don't know enough about this setup to figure out how to fix it.

I get R from the software source:
http://lib.stat.cmu.edu/R/CRAN/bin/linux/ubuntu.  Just installed R
version 2.11.1 (2010-05-31)

My operating system is 9.10 Karmic, kernel 2.6.31-22-generic.

I'm guessing that either there's a bug in javareconf or in the Sun
Java installation on my version of Ubuntu.  Not sure if there's a
workaround or whether there is some bug bboard to which I should
report this.

Suggestions welcome!



More information about the R-SIG-Debian mailing list