Hi all! I recently tried to install the rJava package on my notebook (Debian Etch / Kernel 2.6.15 / jdk 1.5.0-5 / R 2.2.1 / rJava ?? the repo one, have a look below). I compiled R myself with "--with-readline=no" and "--enable-R-shlib flags". Now, each time loading the library rJava I encouter the same error. I reinstalled several times (as root), always the same problem: JNI_GetCreatedJavaVMs is undefined, isn't it?! I couldn't find anything to that problem so far.. What went wrong? Do I have the recent repository for rJava? How can I fix this? Many thanks in advance!! Lothar [code] drops R-2.2.1 # R R : Copyright 2005, The R Foundation for Statistical Computing Version 2.2.1 (2005-12-20 r36812) ISBN 3-900051-07-0 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. Natural language support but running in an English locale R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R.> install.packages("rJava",contriburl="http://www.rosuda.org/R/")trying URL 'http://www.rosuda.org/R//rJava_0.3-6.tar.gz' Content type 'application/x-tar' length 60116 bytes opened URL =================================================downloaded 58Kb * Installing *source* package 'rJava' ... checking for gcc... gcc 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 accepts -g... yes checking for gcc option to accept ANSI C... none needed checking how to run the C preprocessor... gcc -E checking for egrep... 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 checking for stdlib.h... (cached) yes checking for GNU libc compatible malloc... yes checking return type of signal handlers... void checking for memset... yes checking for mkdir... yes checking for rmdir... yes checking for select... yes checking for socket... yes checking endianess... intel-like checking for java... /usr/bin/java checking Java environment home... in /usr/local/java/current checking for /usr/local/java/current/include/jni.h... yes checking for /usr/local/java/current/include/./jni_md.h... no checking for /usr/local/java/current/include/linux/jni_md.h... yes checking whether JNI programs can be compiled... yes checking JNI data types... ok checking whether threads support is requested... no configure: creating ./config.status config.status: creating src/Makevars config.status: creating R/zzz.R config.status: creating src/config.h ** libs gcc -I/usr/local/lib/R/include -I/usr/local/include -I/usr/local/java/current/include -I/usr/local/java/current/include/linux -fPIC -g -O2 -c callJNI.c -o callJNI.o gcc -I/usr/local/lib/R/include -I/usr/local/include -I/usr/local/java/current/include -I/usr/local/java/current/include/linux -fPIC -g -O2 -c initJNI.c -o initJNI.o gcc -I/usr/local/lib/R/include -I/usr/local/include -I/usr/local/java/current/include -I/usr/local/java/current/include/linux -fPIC -g -O2 -c Rglue.c -o Rglue.o gcc -I/usr/local/lib/R/include -I/usr/local/include -I/usr/local/java/current/include -I/usr/local/java/current/include/linux -fPIC -g -O2 -c rJava.c -o rJava.o gcc -shared -L/usr/local/lib -o rJava.so callJNI.o initJNI.o Rglue.o rJava.o -L -ljvm -L/usr/local/lib/R/lib -lR ** R ** help >>> Building/Updating help pages for package 'rJava' Formats: text html latex example accessOp text html latex example jarray text html latex example jarrayRef-class text html latex jcall text html latex example jcast text html latex example jfloat-class text html latex jfloat text html latex jinit text html latex example jnew text html latex example jnull text html latex example jobjRef-class text html latex jreflection text html latex example print text html latex ** building package indices ... * DONE (rJava) The downloaded packages are in /tmp/RtmptQkoVL/downloaded_packages> library(rJava)Error in dyn.load(x, as.logical(local), as.logical(now)) : unable to load shared library '/usr/local/lib/R/library/rJava/libs/rJava.so': /usr/local/lib/R/library/rJava/libs/rJava.so: undefined symbol: JNI_GetCreatedJavaVMs Error in library(rJava) : .First.lib failed for 'rJava'> hum???[/code]
Lothar, as per posting guide, please discuss issues with contributed packages with the maintainer. On Apr 15, 2006, at 4:59 PM, Lothar Rubusch wrote:> I recently tried to install the rJava package on my notebook > (Debian Etch / Kernel 2.6.15 / jdk 1.5.0-5 / R 2.2.1 / rJava ?? the > repo one, have a look below). I compiled R myself with "--with- > readline=no" and "--enable-R-shlib flags". Now, each time loading > the library rJava I encouter the same error. I reinstalled several > times (as root), always the same problem: > JNI_GetCreatedJavaVMs is undefined, isn't it?! I couldn't find > anything to that problem so far.. > > What went wrong? > Do I have the recent repository for rJava? > How can I fix this? >From the configure output it seems as if you have a fake libjvm.so, because there are no library paths and yet it compiles. Please make sure that the correct java, javac etc. are on your PATH before you compile the package. Also make sure that your Java is properly installed (preferably from a Debian package). If that doesn't help, please send me your config.log. Cheers, Simon
> -----Urspr?ngliche Nachricht----- > Von: Simon Urbanek <simon.urbanek at r-project.org> > Gesendet: 17.04.06 18:41:52 > An: Lothar Rubusch <l.rubusch at web.de> > CC: r-devel at r-project.org > Betreff: Re: [Rd] cannot load rJava in R> Lothar, > > as per posting guide, please discuss issues with contributed packages > with the maintainer. > > On Apr 15, 2006, at 4:59 PM, Lothar Rubusch wrote: > > > I recently tried to install the rJava package on my notebook > > (Debian Etch / Kernel 2.6.15 / jdk 1.5.0-5 / R 2.2.1 / rJava ?? the > > repo one, have a look below). I compiled R myself with "--with- > > readline=no" and "--enable-R-shlib flags". Now, each time loading > > the library rJava I encouter the same error. I reinstalled several > > times (as root), always the same problem: > > JNI_GetCreatedJavaVMs is undefined, isn't it?! I couldn't find > > anything to that problem so far.. > > > > What went wrong? > > Do I have the recent repository for rJava? > > How can I fix this? > > > > From the configure output it seems as if you have a fake libjvm.so, > because there are no library paths and yet it compiles. Please make > sure that the correct java, javac etc. are on your PATH before you > compile the package. Also make sure that your Java is properly > installed (preferably from a Debian package). If that doesn't help, > please send me your config.log. > > Cheers, > Simon >Hey all! Thank you for giving me the hint and for your very friendly help, I appreciate!! - True, true reading error messages in some case might be helpful.. Here is what I found out: In brief LD_LIBRARY_PATHS was not set up correctly. It has to be set to the path of the shared objects depending on where someone has installed the JDK. I installed it under /usr/local/java/current/ so for me that's: /usr/local/java/current/jre/lib/i386/ /usr/local/java/current/jre/lib/i386/client/ But this was not sufficient, R asked for another rJava.so so I had to add the following path, too (that's where I found the shared object using locate): /usr/local/lib/R/site-library/rJava/libs/ In conclusion this line did the job: #export LD_LIBRARY_PATH=/usr/local/java/current/jre/lib/i386/:/usr/local/java/current/jre/lib/i386/client/:/usr/local/lib/R/site-library/rJava/libs/ Now it runs smoothly! Nice! Best regards, Lothar PS: Some words on the official debian java packages: I can't consider if this still is the state of the art, but I could not find anything that it already has changed. Generally there might be some policy problems with SUN's Java packages and Debian. So the Debian packages (e.g. java-common) afaik are using Blackdown's Java implementations, in Java Version 1.4.2. But with a dummy package it is possible to do a workaround: http://www.debian.org/doc/manuals/debian-java-faq/ch11.html#s11.2 Thus afaik it is - at least - not always possible to resist only on the official .deb files for Java.