[Rd] rJava downloads but cannot load, when I run R as root (PR#13994)

Dirk Eddelbuettel edd at debian.org
Sat Oct 10 15:49:06 CEST 2009


On 10 October 2009 at 05:40, lmramba at gmail.com wrote:
| > library(rJava)
| Error in library(rJava) : there is no package called 'rJava'
| > install.packages("rJava")
| Warning in install.packages("rJava") :
|   argument 'lib' is missing: using '/usr/local/lib/R/site-library'
| --- Please select a CRAN mirror for use in this session ---
| Loading Tcl/Tk interface ... done
| trying URL 'http://cran.uk.r-project.org/src/contrib/rJava_0.7-0.tar.gz'
| Content type 'application/x-gzip' length 249486 bytes (243 Kb)
| opened URL
| =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
| =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
| downloaded 243 Kb
| 
| * Installing *source* package =91rJava=92 ...
| checking for gcc... gcc -std=3Dgnu99
| checking for C compiler default output file name... a.out
[...]
| configure: checking whether gcc -std=3Dgnu99 supports static inline...
| yes
| checking Java support in R... present:
| interpreter : '/usr/bin/java'
| archiver    : '/usr/bin/jar'
| compiler    : '/usr/bin/javac'
| header prep.: '/usr/bin/javah'
| cpp flags   : ''
| java libs   : '-L/usr/lib/jvm/java-6-openjdk/jre/lib/i386/server
| -L/usr/lib/jvm/java-6-openjdk/jre/lib/i386
| -L/usr/lib/jvm/java-6-openjdk/jre/../lib/i386 -L
| -L/usr/java/packages/lib/i386 -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.

R tells you your Java setup is not right. This *is* difficult, which is why I
have offered to maintain and provide the rJava in Debian / Ubuntu as r-cran-rjava.

As demonstrated to you two emails ago, it also works.  I would use that.
Otherwise, fix your Java setup first as R told you to here.


| 
| 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 =91rJava=92
| * Removing =91/usr/local/lib/R/site-library/rJava=92
| 
| The downloaded packages are in
|     =91/tmp/RtmpOjM9hY/downloaded_packages=92
| Warning message:
| In install.packages("rJava") :
|   installation of package 'rJava' had non-zero exit status
| >
| 
| 
| I went ahead and did this:
| 
| root at lmramba-laptop:/home/lmramba# 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/server:$(JAVA_HOME)/lib/i386:$(JAVA_HOME)/../lib/i386=
| ::/usr/java/packages/lib/i386:/lib:/usr/lib
| JNI linker flags : -L$(JAVA_HOME)/lib/i386/server -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.
| 
| 
| But still installing rJava fails

As before: not a bug in R and you just created extra work for R Core to
maintain the bug database.

Dirk


| Plz help
| 
| Regards,
| Lazarus
| 
| 	[[alternative HTML version deleted]]
| 
| ______________________________________________
| R-devel at r-project.org mailing list
| https://stat.ethz.ch/mailman/listinfo/r-devel

-- 
Three out of two people have difficulties with fractions.



More information about the R-devel mailing list