I completely removed the java-sun version and install the openjdk instead.
I re-launched the R CMD reconf.
The installation still failed !
> install.packages("rJava")
Warning in install.packages("rJava") :
argument 'lib' is missing: using
'/home/martial/R/x86_64-unknown-linux-gnu-library/2.9'
trying URL 'http://cran.fr.r-project.org/src/contrib/rJava_0.6-2.tar.gz'
Content type 'application/x-tar' length 237115 bytes (231 Kb)
opened URL
=================================================downloaded 231 Kb
* Installing *source* package ‘rJava’ ...
checking Java support in R... present:
interpreter : '/usr/bin/java'
archiver : ''
compiler : ''
header prep.: ''
cpp flags : '-I/usr/lib/jvm/java-6-openjdk/jre/../include'
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/lib64 -L/lib64 -L/lib -L/usr/lib -ljvm'
configure: error: Java Development Kit (JDK) is missing or not registered in R
Make sure R is configured with full Java support (including JDK). Run
R CMD javareconf
as root to add Java support to R.
It's interesting to notice that the result of the javareconf is totally
different:
~$ R CMD javareconf -e /bin/bash
Java interpreter : /usr/lib/jvm/java-6-openjdk//jre/bin/java
Java version : 1.6.0_0
Java home path : /usr/lib/jvm/java-6-openjdk/
Java compiler : /usr/lib/jvm/java-6-openjdk//bin/javac
Java headers gen.: /usr/lib/jvm/java-6-openjdk//bin/javah
Java archive tool: /usr/lib/jvm/java-6-openjdk//bin/jar
Java library path:
$(JAVA_HOME)jre/lib/amd64/server:$(JAVA_HOME)jre/lib/amd64:$(JAVA_HOME)jre/../lib/amd64::/usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib
JNI linker flags : -L$(JAVA_HOME)jre/lib/amd64/server
-L$(JAVA_HOME)jre/lib/amd64 -L$(JAVA_HOME)jre/../lib/amd64 -L
-L/usr/java/packages/lib/amd64 -L/usr/lib64 -L/lib64 -L/lib -L/usr/lib -ljvm
JNI cpp flags : -I$(JAVA_HOME)/include
The following Java variables have been exported:
JAVA_HOME JAVA JAVAC JAVAH JAR JAVA_LIBS JAVA_CPPFLAGS JAVA_LD_LIBRARY_PATH
Runnig: /bin/bash
However,
~$ sudo R CMD javareconf
Java interpreter : /usr/bin/java
Java version : 1.6.0_0
Java home path : /usr/lib/jvm/java-6-openjdk/jre
Java compiler : not present
Java headers gen.:
Java archive tool:
Java library path:
$(JAVA_HOME)/lib/amd64/server:$(JAVA_HOME)/lib/amd64:$(JAVA_HOME)/../lib/amd64::/usr/java/packages/lib/amd64:/usr/lib64:/lib64:/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/lib64
-L/lib64 -L/lib -L/usr/lib -ljvm
JNI cpp flags : -I$(JAVA_HOME)/../include
Updating Java configuration in /usr/local/lib64/R
Done.
In fact the javareconf is called in sudo mode during the installation of the
package rjava.
How can I fix the java support in sudo mode ?
Any ideas ??
> From: martial100kar@hotmail.com
> To: r-help@r-project.org
> Date: Thu, 30 Apr 2009 10:43:38 +0000
> Subject: [R] rjava - JDK not found
>
>
> Hi,
>
> I would like to test the new package RGG (R Gui Generator). This package
requires the installation of several other package.
> One of them is rJava.
> I installed sun-java6-jdk and run the R CMD javareconf but the installation
still fails !
>
> Do you have any ideas ?
>
>
>
>
> * Installing *source* package ‘rJava’ ...
> checking for gcc... gcc -std=gnu99
> checking for C compiler default output file name... a.out
> checking whether the C compiler works... yes
> checking whether we are cross compiling... no
> checking for suffix of executables...
> checking for suffix of object files... o
> checking whether we are using the GNU C compiler... yes
> checking whether gcc -std=gnu99 accepts -g... yes
> checking for gcc -std=gnu99 option to accept ISO C89... none needed
> checking how to run the C preprocessor... gcc -std=gnu99 -E
> checking for grep that handles long lines and -e... /bin/grep
> checking for egrep... /bin/grep -E
> checking for ANSI C header files... yes
> checking for sys/wait.h that is POSIX.1 compatible... yes
> checking for sys/types.h... yes
> checking for sys/stat.h... yes
> checking for stdlib.h... yes
> checking for string.h... yes
> checking for memory.h... yes
> checking for strings.h... yes
> checking for inttypes.h... yes
> checking for stdint.h... yes
> checking for unistd.h... yes
> checking for string.h... (cached) yes
> checking sys/time.h usability... yes
> checking sys/time.h presence... yes
> checking for sys/time.h... yes
> checking for unistd.h... (cached) yes
> checking for an ANSI C-conforming const... yes
> checking whether time.h and sys/time.h may both be included... yes
> configure: checking whether gcc -std=gnu99 supports static inline...
> yes
> checking Java support in R... present:
> interpreter : '/usr/lib/jvm/java-6-sun/jre/bin/java'
> archiver : '/usr/lib/jvm/java-6-sun/bin/jar'
> compiler : '/usr/lib/jvm/java-6-sun/bin/javac'
> header prep.: '/usr/lib/jvm/java-6-sun/bin/javah'
> cpp flags : '-I/usr/lib/jvm/java-6-sun/include
-I/usr/lib/jvm/java-6-sun/include/linux'
> java libs : '-L/usr/lib/jvm/java-6-sun-1.6.0.07/jre/lib/amd64/server
-L/usr/lib/jvm/java-6-sun-1.6.0.07/jre/lib/amd64
-L/usr/lib/jvm/java-6-sun-1.6.0.07/jre/../lib/amd64 -L
-L/usr/java/packages/lib/amd64 -L/lib -L/usr/lib
-ljvm:-L/usr/lib32:-L/usr/lib64'
> checking whether JNI programs can be compiled... configure: error: Cannot
compile a simple JNI program. See config.log for details.
>
> Make sure you have Java Development Kit installed and correctly registered
in R.
> If in doubt, re-run "R CMD javareconf" as root.
>
> ERROR: configuration failed for package ‘rJava’
>
>
> _________________________________________________________________
> Découvrez toutes les possibilités de communication avec vos proches
>
> [[alternative HTML version deleted]]
>
_________________________________________________________________
Découvrez toutes les possibilités de communication avec vos proches
[[alternative HTML version deleted]]