[R-sig-Debian] Trouble compiling Java-based R packages

Peter Muhlberger pmuhl1848 at gmail.com
Tue Jun 8 22:02:58 CEST 2010


Hi Dirk:  Thanks for the reply!

I'm sorry, but I think I tried openjdk, without success.  I'm
currently using the "http://lib.stat.cmu.edu/R/CRAN/bin/linux/ubuntu"
source, which appears to contain the Debian r-core.  If so, you seem
to be suggesting I try to use openjdk-6-jdk.  Telling from my run of
"sudo update-alternatives --config java", I gather that openjdk-6 was
my default Java installation.  I then installed the openjdk jdk, my
cpp flags pointed to '-I/usr/lib/jvm/java-6-openjdk/jre/../include'.
But, when I try to compile rJava, I get:  "One or more JNI types
differ from the corresponding native type."  rJava won't compile.
Should I be doing this differently?

Thanks again,

Peter

On Tue, Jun 8, 2010 at 2:22 PM, Dirk Eddelbuettel <edd at debian.org> wrote:
>
> Peter,
>
> On 8 June 2010 at 13:51, Peter Muhlberger wrote:
> | Hi folks:  I guess my earlier posting was too involved, so let me try
> | to get to the essence of my problem.
> |
> | I recently tried to compile JGR, rJava, etc. into my updated R.
> | First, I ran: R CMD javareconf.  The output from that tells me that
> | "JAVA_HOME is not a valid path, ignoring" and the cpp flags are set to
> | nothing.  The javareconf fills most of the variables with references
> | to openjdk.  JAVA_HOME, as far as I can tell, points to a properly
> | installed copy of Sun Java.  When I run update.packages(checkBuilt=T)
> | with this, it unsurprisingly tells me that "One or more Java
> | configuration variables are not set" and all of my Java based programs
> | fail to compile.
> |
> | I've tried switching the default Java to the Sun version using "sudo
> | update-alternatives --config java".  Now, javareconf fills in the cpp
> | flag and variables point to the Sun version, though I still get the
> | error msg that JAVA_HOME is not a valid path (though javareconf sets
> | the home path to: /usr/lib/jvm/java-6-sun-1.6.0.20/jre).  When I try
> | to compile rJava, I get the error: rJava, "JNI types differ from the
> | native type."
> |
> | Does anyone have any thoughts on how to fix this?  Alternatively, is
> | there somewhere I can report these problems so they might get fixed in
> | future versions?  I suspect I can't be the only person having these
> | problems.
>
> Quick caveat: I am not a Java user or programmer.
>
> That said, I had wanted to get this work for years because several
> interesting packages build on-top of rjava.  And as of a few years ago it
> started to work so I since then I am
>
>  a) instrumenting Debian's r-base-core package to be Java-aware
>
>  b) packaging /maintaining rjava for Debian as well
>
> but all of that only with the non-Sun packages. E.g. rjava has a
> build-depends on openjdk-6-jdk, and that seems to work.  So start by
> installing that.
>
> I have also built JGR and other packages, and have the cran2deb robot build
> quite a few more.  But never with the Sun java, and certainly never when
> mixing.
>
> Beyond that, maybe the Java lists can be of more help than we can here.
>
> --
>  Regards, Dirk
>



More information about the R-SIG-Debian mailing list