[kaffe] Incorrect handling of library search paths

Matthew Johnson matt at matthew.ath.cx
Tue Jan 10 09:49:07 PST 2006


I have a Java program that loads a native library. This is called
libdbus-java.so. There is a copy of it in /usr/lib/jni/ from the
installed package, and also an incompatible version in the current
directory, which I am trying to test.

The library is loaded using System.loadLibrary("dbus-java");

I run the program with:

kaffe -Djava.library.path=.:/usr/lib -classpath libdbus-java-0.2.jar:dbus-java-test-0.2.jar org.freedesktop.dbus.test.test

-Djava.library.path should cause kaffe to search the current directory
followed by /usr/lib for dynamic libraries. Infact, kaffe loads the old
libdbus-java.so from /usr/lib/jni/.

Using Sun Java rather than Kaffe works as expected.

If I set LD_LIBRARY_PATH=. the correct behavior happens:

LD_LIBRARY_PATH=. kaffe -Djava.library.path=.:/usr/lib -classpath libdbus-java-0.2.jar:dbus-java-test-0.2.jar org.freedesktop.dbus.test.test

but surely Kaffe should behave the same as Sun Java?

Matt

-- 
Matthew Johnson
http://www.matthew.ath.cx/




More information about the kaffe mailing list