[R] Problem loading rJava...

Brian Lunergan ff809 at ncf.ca
Mon Aug 15 17:18:27 CEST 2011


Morning All:

Having problems installing this one into my R setup and wondered if
anyone on the list had the same problem and found a workable solution.

First to the system particulars:

OS is the Hardy Heron edition of Ubuntu Linux
R version is 2.13.1
Java installation is sun-java6

Next up is the result of javareconf:

 R CMD javareconf
Java interpreter : /usr/bin/java
Java version     : 1.5.0
Java home path   : /usr/lib/jvm/java-1.5.0-gcj-4.2-1.5.0.0/jre
Java compiler    : /usr/bin/javac
Java headers gen.: /usr/bin/javah
Java archive tool: /usr/bin/jar
Java library path: /usr/lib/../lib/gcj-4.2-81:/usr/lib/jni
JNI linker flags : -L/usr/lib/../lib/gcj-4.2-81 -L/usr/lib/jni -ljvm
JNI cpp flags    : 

Updating Java configuration in /etc/R
Done.

What little I've been able to find on this problem suggests that the
blank space beside the cpp flags variable is the key point, but all the
notes I found suggest programming solutions outside of my abilities. Are
there any simple and to the point solutions that correct this issue, or
am I SOL for using the package? Any help would be greatly appreciated as
install of other packages and R commander plugins depend on solving it.
Oh, yes. Here's the result when I try to pull in rJava.

> install.packages()
Loading Tcl/Tk interface ... done
--- Please select a CRAN mirror for use in this session ---
Installing package(s) into ‘/usr/local/lib/R/site-library’
(as ‘lib’ is unspecified)
trying URL 'http://cran.skazkaforyou.com/src/contrib/rJava_0.9-1.tar.gz'
Content type 'application/x-gzip' length 527197 bytes (514 Kb)
opened URL
==================================================
downloaded 514 Kb

* 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 ISO C89... none needed
checking how to run the C preprocessor... gcc -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 supports static inline...
yes
checking whether setjmp.h is POSIX.1 compatible... yes
checking whether sigsetjmp is declared... yes
checking whether siglongjmp is declared... 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/../lib/gcj-4.2-81 -L/usr/lib/jni -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.

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/Rtmph5lTVR/downloaded_packages’
Warning message:
In install.packages() :
  installation of package 'rJava' had non-zero exit status
> 


-- 
Brian Lunergan
Nepean, Ontario
Canada



More information about the R-help mailing list