[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

JGR with free java (was: GUI for R)



cc: debian-java -> I need a bit of help here, see below

On Wednesday 11 October 2006 15:48, Dirk Eddelbuettel wrote:
> | > Unfortunately, JGR is still somewhat outside Debian as it wants Sun's
> | > Java JDK so I don't think I'll ever package it directly.  Now, if
> | > someone wanted to outside of Debian ...  In fact, the CRAN maintainers
> | > mention that idea. Maybe one day.
> |
> | Did you try it with JamVM/Classpath? I will have a go at that in running
> | JGR, and report problems with the Classpath team.
>
> I do not use Java myself, so I wouldn't be the one to try this.  It would
> be nice if someone like you with R and Java clues coud try it.  I honestly
> do not know what is involved but I have the suspicion that it is no cake
> walk.

I've found out that it now actually is a package on CRAN, and installs fine, 
and really just depends on rJava for the Java binding. (JGR and rJava are 
downloaded as source tar.gz from [1]).

I had a brief go at installing rJava against GIJ:

$ JAVA_HOME=/usr/lib/jvm/java-1.4.2-gcj-4.1-1.4.2.0 R CMD 
INSTALL --library=/usr/local/lib/R/site-library rJava_0.4-11.tar.gz

(R comes with the package r-base).

You need to have java-gcj-compat-dev and libgcj-bc installed.

But it fails because of this call:

/usr/lib/jvm/java-1.4.2-gcj-4.1-1.4.2.0/bin/javac -target 1.4 -source 
1.4 -target 1.4 -source 1.4 -classpath src/JRI.jar -d examples 
examples/rtest.java

Note the duplicate '-target 1.4 -source 1.4', which is OK for the Sun javac, 
but breaks compiling with gcj 4.1 javac.

A workaround is not compiling the examples, which can be done by modifying 
(after tar zxvf) the rJava/jri/Makefile.all, and make it look like:

examples/%.class: examples/%.java src/JRI.jar
        #$(JAVAC) $(JFLAGS) -classpath src/JRI.jar -d examples $<

Then the package installs.

However, running it still fails with this error:
$ R
<snip>

and then on the R command line:
> library(rJava)

which fails with:

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 in library(rJava) : .First.lib failed for 'rJava'

Not sure what else I can/should try now. Ideas?

Egon

1.http://cran.r-project.org/src/contrib/PACKAGES.html

-- 
e.willighagen@science.ru.nl
Cologne University Bioinformatics Center (CUBIC)
Blog: http://chem-bla-ics.blogspot.com/
GPG: 1024D/D6336BA6



Reply to: