When compiling the following program with gcj -Djava.library.path=/usr/lib/jni --main t t.java does print that java.library.path is set to /usr/lib/jni, but this value isn't used to actually load a library in the next statement. When defining the environment variable LD_LIBRARY_PATH a library in /usr/lib/jni can be found.
public class t { public static void main(String[] args) { System.out.println(System.getProperty("java.library.path")); System.loadLibrary(args[0]); } } Also setting GCJ_PROPERTIES=java.library.path=/usr/lib/jni doesn't work. -- Summary: System property java.library.path doesn't get used by System.loadLibrary() Product: gcc Version: 4.0.0 Status: UNCONFIRMED Severity: normal Priority: P2 Component: libgcj AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: mark at gcc dot gnu dot org CC: gcc-bugs at gcc dot gnu dot org,java-prs at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18234