[R] Problem with rjava in linux

Ronaldo Reis Junior chrysopa at gmail.com
Thu Feb 22 00:02:38 CET 2007


I install rJava in linux. The installation, from source, is ok. But I have 
this error on load package.

> library(rJava)
Error in dyn.load(x, as.logical(local), as.logical(now)) : 
        unable to load shared 
library '/usr/local/lib/R/site-library/rJava/libs/rJava.so':
  libjvm.so: cannot open shared object file: No such file or directory
Error: .onLoad failed in 'loadNamespace' for 'rJava'
Error: package/namespace load failed for 'rJava'

Look my env:

[root em mobilix ronaldo]# echo $JAVA_HOME

[root em mobilix ronaldo]# R CMD javareconf
Java interpreter : /usr/lib/jvm/java-1.5.0-sun-
Java version     : 1.5.0_10
Java home path   : /usr/lib/jvm/java-1.5.0-sun-
Java library path: $(JAVA_HOME)/jre/lib/i386/client:$(JAVA_HOME)/jre/lib/i386:
JNI linker 
flags : -L$(JAVA_HOME)/jre/lib/i386/client -L$(JAVA_HOME)/jre/lib/i386 -L$(JAVA_HOME)/jre/../lib/i386 -ljvm

Updating Java configuration in /etc/R

and the file exist

[root em mobilix ronaldo]# ls /usr/local/lib/R/site-library/rJava/libs/

The library libjvm.so also exist

[root em mobilix ronaldo]# locate libjvm.so 

Now I try to remove the /usr/lib/gcj-4.1/libjvm.so because is not a SUN 

[root em mobilix ronaldo]# dpkg -S /usr/lib/gcj-4.1/libjvm.so
libgcj7-0: /usr/lib/gcj-4.1/libjvm.so
[root em mobilix ronaldo]# apt-get remove libgcj7-0 --purge

Now, I try to reinstall rjava, but now, the instalation dont work.

> install.packages('rJava',,'http://rforge.net',type='source')

h src/JRI.jar -d examples examples/rtest.java
Note: examples/rtest.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
make[1]: Leaving directory `/tmp/R.INSTALL.To6153/rJava/jri'
** R
** inst
** preparing package for lazy loading
Error in parse(n = -1, file = file) : input buffer overflow
Error: unable to load R code in package 'rJava'
Execution halted
ERROR: lazy loading failed for package 'rJava'
** Removing '/home/local/lib/R/site-library/rJava'

The downloaded packages are in
Warning message:
installation of package 'rJava' had non-zero exit status in: 
install.packages("rJava", , "http://rforge.net", type = "source") 

My R version is R version 2.4.1 (2006-12-18)

How to make success on rJava instalation?

The last thing one knows in constructing a work is what to put first.
		-- Blaise Pascal
> Prof. Ronaldo Reis Júnior
|  .''`. UNIMONTES/Depto. Biologia Geral/Lab. Ecologia Evolutiva
| : :'  : Campus Universitário Prof. Darcy Ribeiro, Vila Mauricéia
| `. `'` CP: 126, CEP: 39401-089, Montes Claros - MG - Brasil
|   `- Fone: (38) 3229-8190 | ronaldo.reis em unimontes.br | chrysopa em gmail.com
| ICQ#: 5692561 | LinuxUser#: 205366

More information about the R-help mailing list