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

Bug#364820: Add /usr/lib/jni to the default java.library.path



Package: gcj-4.0
Version: 4:4.0.3-3
Severity: important
Justification: violates a *should* directive of the Debian Policy for Java

The default java.library.path of applications compiled using gcj does
not include /usr/lib/jni. The Debian Policy for Java [1] states that
/usr/lib/jni *should* be the default.

$ gcj -I/usr/share/java/swt.jar Hello.java -lswt -lswt-pi --main=Hello -oHello
$ ./Hello
Exception in thread "main" java.lang.UnsatisfiedLinkError:
libswt-pi-gtk-3139: libswt-pi-gtk-3139.so: cannot open shared object
file: No such file or directory
   at java.lang.Runtime._load(java.lang.String, boolean)
(/usr/lib/libgcj.so.6.0.0)
...
$ LD_LIBRARY_PATH=/usr/lib/jni ./Hello
[works]

The rpath can be used, although this is not recomended by Debian policy.

$ gcj -I/usr/share/java/swt.jar Hello.java -lswt -lswt-pi --main=Hello
-oHello -Wl,-rpath,/usr/lib/jni
$ ./Hello
[works]

... or /usr/lib/jni can be added to /etc/ld.so.conf.

$ sudo sh -c 'echo /usr/lib/jni >>/etc/ld.so.conf'
$ sudo ldconfig
$ ./Hello
[works]

However, I'd like to see /usr/lib/jni added to the default
java.library.path of an application compiled with gcj.

Cheers,
Shaun

[1] http://www.debian.org/doc/packaging-manuals/java-policy/x105.html

Reply to: