[fedora-java] Dealing with LD_LIBRARY_PATH for a package using JNI

Andrew Haley aph at redhat.com
Tue Apr 8 12:47:12 UTC 2008


Mary Ellen Foster wrote:
> I'm currently working on enabling the "jpl" Java interface to the SWI
> Prolog (package is called "pl" in Fedora). This provides a
> bidirectional interface between Prolog and Java -- you can call Prolog
> from Java or (what I'm doing in my current project) call Java from
> Prolog.
> 
> I'm attempting to follow the Java packaging guidelines for JNI-using
> projects and putting jpl.jar and libjpl.so into $LIBDIR/pl-jpl and
> patching files so that the libraries get loaded, and that's going
> well.
> 
> One thing I'm not sure how to deal with: libjpl.so is linked against
> libjava.so and libjvm.so. On my machine, that means I need to set
> LD_LIBRARY_PATH to
> /usr/lib/jvm/java/jre/lib/i386:/usr/lib/jvm/java/jre/lib/i386/client
> before I run Prolog, and the same is probably the case if I wanted to
> use the Java-to-Prolog direction.

The command-line program 'java' already sets its LD_LIBRARY_PATH, so
it shouldn't be necessary when calling from Java.

Andrew.




More information about the java-devel mailing list