[R] Installing R in Linux: problems with JAVA packages (rJava, RWeka, ...) ?

Martyn Plummer plummer at iarc.fr
Wed Oct 22 11:49:20 CEST 2008


On Tue, 2008-10-21 at 15:36 +0100, Paulo Cortez wrote:
> Hi,
> 
> While in MacOS it is quite simple to install R and Java packages, the 
> same is not true for Linux. I surfed the web and it seems that other 
> users also have similar problems. Perhaps a nice FAQ answer or HOWTO 
> would help...
> 
> But here is my situation: I have 2 linux servers, one with Fedora 9 and 
> the other with CentOS5.

Fedora and CentOS do support Java, but not the Sun version since it is
not free software. You would need to buy the commercial Red Hat
Enterprise Linux if you wanted that.

Both Fedora and CentOS provide the "java-1.6.0-openjdk" and
"java-1.6.0-openjdk-devel" RPMs.  The post install scripts of these RPMs
will set up your Java environment, including creating the necessary
symbolic links (although you may need to remove your hand-made symbolic
links first to ensure that this works correctly).

There is also GNU java (java-1.5.0-gcj-devel). Although you can install
the GNU and OpenJDK versions in parallel, you can only use one of them
exclusively at any time (the choice is managed using the "alternatives"
command).  I once ended up with a mixed GNU/OpenJDK Java enviroment
which did not work.  In fact I got exactly the same error message you
did.

continued below ...

> I have installed R (2.7.2 version, with yum) and I tryed to install the 
> RWeka and rJava packages.
> 
> After receiving an error, I installed jdk1.6 from java (file:
> jdk-6u10-linux-i586-rpm.bin?AuthParam=1224512972_e5a9932e886a02f44dfdfe48aad02db8&TicketId=B%2Fw2nBuFSltLQRRFM1JblgDk&GroupName=CDS&FilePath=%2FESD5%2FJSCDL%2Fjdk%2F6u10%2Fjdk-6u10-linux-i586-rpm.bin&File=jdk-6u10-linux-i586-rpm.bin)
> in both machines.
> 
> Then, I had to manually set the java links, using something like:
> 
> # rm /usr/bin/java
> # ln -sv /usr/java/default/bin/java /usr/bin/java
> 
> (repeat these lines for javac, javadoc, javah, etc..)
> 
> Finally I performed (in both machines):
> 
> R CMD javareconf (as root)
> 
> In Fedora9, I opened R and the package installation went well.
> But in the CentOS5 machine, I received the error:
> ---------
> checking Java support in R... configure: error: absent
> R was configured without Java support. Please run
> R CMD javareconf
> as root to add Java support to R.
> 
> If you don't have root privileges, run
> R CMD javareconf -e
> ---------
> Since the R CMD javareconf did not work, I tryed instead:
> R CMD javareconf -e
> 
> And now I receive the error:
> checking whether JNI programs can be compiled... configure: error: 
> Cannot compile a simple JNI program. See config.log for details.
> 
> Currently, I do not know how to resolve this error. Where is the 
> config.log file? As a root, I did: # find / -name config.log .print
> and find no file regarding this JNI error. Also, it is quite difficult 
> for a non expert to resolve this type of errors... Any help?


... You don't see the config.log file because the package is unpacked
and built in a temporary directory.  If you want to inspect the log file
you need to download the package, untar it, and then type "R CMD INSTALL
rJava".

In my case, the config.log was not particularly helpful. The linker
complained about not being able to find libjvm, but this was just a
symptom of a broken Java configuration.

I hope this helps.
Martyn

> Regards,

-----------------------------------------------------------------------
This message and its attachments are strictly confidenti...{{dropped:8}}



More information about the R-help mailing list