[Bug 166] New: System.loadLibrary: look in platform default library paths
[email protected] Sun, 18 Dec 2005 11:31:00 -0500
| Newsgroups | gmane.comp.java.vm.sablevm.bugs |
|---|---|
| Message-ID | <[email protected]> |
http://sablevm.org/bugs/show_bug.cgi?id=166
Summary: System.loadLibrary: look in platform default library
paths
Product: SableVM
Version: unspecified
Platform: PC
OS/Version: Linux
Status: NEW
Severity: enhancement
Priority: P2
Component: default
AssignedTo: [email protected]
ReportedBy: [email protected]
QAContact: [email protected]
It would be nice if, to be compatible with some other JVMs like gij and Sun JDK,
System.loadLibrary could automatically look in /lib and /usr/lib (or /lib64 and
/usr/lib64 as appropriate) if it doesn't find the library in the locations
listed in the relevant system properties.
Here is a test program (which obviously assumes that the named library exists in
a standard directory!)
public class TestLib {
public static void main (String args []) {
System.out.println ("java.library.path = " + System.getProperty
("java.library.path"));
System.out.println ("gnu.classpath.boot.library.path = " +
System.getProperty ("gnu.classpath.boot.library.path"));
System.loadLibrary ("swt-pi-gtk-3139");
}
}
Output when run on sablevm SDK 1.13:
java.library.path = .
gnu.classpath.boot.library.path = /usr/local/lib/sablevm-classpath
java.lang.UnsatisfiedLinkError: Native library `swt-pi-gtk-3139' not found (as
file `libswt-pi-gtk-3139') in gnu.classpath.boot.library.path and java.library.path
at java.lang.Runtime.loadLibrary (Runtime.java:767)
at java.lang.System.loadLibrary (System.java:516)
at TestLib.main (TestLib.java:6)
at java.lang.VirtualMachine.invokeMain (VirtualMachine.java)
at java.lang.VirtualMachine.main (VirtualMachine.java:108)
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
You are the QA contact for the bug, or are watching the QA contact.