Skip to content

rJava in R 2.8.1 on Ubuntu 8.10

5 messages · Michael Rutter, Stefan Th. Gries, Dirk Eddelbuettel

#
Hi all

I have problems installing rJava on my system.

######## My system:
platform       x86_64-pc-linux-gnu
arch           x86_64
os             linux-gnu
system         x86_64, linux-gnu
status
major          2
minor          8.1
year           2008
month          12
day            22
svn rev        47281
language       R
version.string R version 2.8.1 (2008-12-22)
java version "1.6.0_0"
IcedTea6 1.3.1 (6b12-0ubuntu6) Runtime Environment (build 1.6.0_0-b12)
OpenJDK 64-Bit Server VM (build 1.6.0_0-b12, mixed mode)
stgries at stgries-acer:~$

on Ubuntu 8.10 (Kernel 2.6.27-9)
on an AMD Phenom Triple-Core



The problem arises here:

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.

When I then do that
I get this:

Updating Java configuration in /etc/R
Done.

However, it still doesn't work, returning the same crap as before.
Also, when I try
I just get

shift: 57: can't shift that many

Any hints would be much appreciated
STG
#
On 26 January 2009 at 17:24, Stefan Th. Gries wrote:
| Hi all
| 
| I have problems installing rJava on my system.
| 
| ######## My system:
| 
| > R.version # at R prompt
| platform       x86_64-pc-linux-gnu
| arch           x86_64
| os             linux-gnu
| system         x86_64, linux-gnu
| status
| major          2
| minor          8.1
| year           2008
| month          12
| day            22
| svn rev        47281
| language       R
| version.string R version 2.8.1 (2008-12-22)
| 
| > java -version # at terminal prompt
| java version "1.6.0_0"
| IcedTea6 1.3.1 (6b12-0ubuntu6) Runtime Environment (build 1.6.0_0-b12)
| OpenJDK 64-Bit Server VM (build 1.6.0_0-b12, mixed mode)
| stgries at stgries-acer:~$
| 
| on Ubuntu 8.10 (Kernel 2.6.27-9)
| on an AMD Phenom Triple-Core
| 
| 
| 
| The problem arises here:
| 
| 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.
| 
| When I then do that
| 
| > sudo R CMD javareconf # at terminal
| 
| I get this:
| 
| Updating Java configuration in /etc/R
| Done.

That's not right.  Did you build your own R, or did you use the Ubuntu 8.10
binaries from CRAN?

This should show something similar to (from my i386 Ubuntu system without
rJava): 

edd at joe:~$ 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    : /usr/bin/javac
Java headers gen.: /usr/bin/javah
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 -L/usr/java/packages/lib/i386 -L/lib -L/usr/lib -ljvm
JNI cpp flags    :

Updating Java configuration in /etc/R
Done.

| However, it still doesn't work, returning the same crap as before.
| Also, when I try
| 
| > R CMD javareconf -e # at terminal
| 
| I just get
| 
| shift: 57: can't shift that many
| 
| Any hints would be much appreciated

What is /bin/sh for you?  On my system /bin/sh -> dash and it works.

FWIW rJava entered Debian this weekend and should be part of the next Ubuntu
release as well.

Dirk
#
Just to confirm on my 64-bit AMD machine based on the amd64 ubuntu
binaries, I get the following:

mrutter at yorick ~> 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    : /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/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 /etc/R
Done.

Michael
On Mon, Jan 26, 2009 at 8:32 PM, Dirk Eddelbuettel <edd at debian.org> wrote:

  
    
4 days later
#
Hi

(Thx for the first responses and sorry for delay, been travelling ...)

Ok, when I copied some parts of my attempt to install rJava, I left
out the stuff that DID work so let me try again more comprehensively:

### R version
platform       x86_64-pc-linux-gnu
arch           x86_64
os             linux-gnu
system         x86_64, linux-gnu
status
major          2
minor          8.1
year           2008
month          12
day            22
svn rev        47281
language       R
version.string R version 2.8.1 (2008-12-22)

### Java version
java version "1.6.0_0"
IcedTea6 1.3.1 (6b12-0ubuntu6.1) Runtime Environment (build 1.6.0_0-b12)
OpenJDK 64-Bit Server VM (build 1.6.0_0-b12, mixed mode)
stgries at stgries-acer:~$


So, I start R with
Then, within R:
and I get:

############
downloaded 231 Kb

* 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/bin/java'
archiver    : ''
compiler    : ''
header prep.: ''
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/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.

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/local/lib/R/site-library/rJava'

The downloaded packages are in
	/tmp/RtmpFN4dvI/downloaded_packages
Warning message:
In install.packages("rJava") :
  installation of package 'rJava' had non-zero exit status
############

So, I enter:
and get

############
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    :

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

But then, when I run
I get the same stuff as before although JDK is installed and I did the
reconf ...

Any pointers,
STG
#
It's almost always the same with failing builds:
On 31 January 2009 at 11:41, Stefan Th. Gries wrote:
[...]
Java home path   : /usr/lib/jvm/java-6-openjdk/jre
[...]

This clearly states that you have the JRE -- ie the __run-time__
environment.  The Builds-Depends [1] are for the package openjdk-6-jdk -- ie
the 'java development kit'.  Install that, re-run 'sudo R CMD javareconf' and
try again.

Dirk

[1] The second-best thing about having Debian packages, besides giving you
the binaries, is that they give you the essentially fail-safe recipe for
building them, including the list of ingredients encoded in the
Build-Depends: line of debian/control. You get that via the .diff.gz