> When i load with System.load with full path to the library it is loaded
> and works ok.
That means there's nothing wrong with the library you built, and that
it has no unresolved dependencies preventing it from loading properly.
I suspect your use of System.loadLibrary() is wrong. What is the full
name of the library, and what is the argument you pass loadLibrary()?
Can you get it to work by setting (and exporting) SHLIB_PATH?
Try running your program under strace or truss or similar, to see
exactly what file the JVM is searching for. For example, here is what
strace tells me System.loadLibrary("foo") is doing on my Linux system:
$ cat Foo.java
public class Foo {
public static void main(String[] args) throws Exception {
System.out.println("java.library.path contains:");
System.out.println(System.getProperty("java.library.path"));
System.out.println();
System.loadLibrary("foo");
}
}
$ strace -o strace.txt java Foo
java.library.path contains:
/usr/local/pgm/jdk1.5.0_09/jre/lib/i386/client:/usr/local/pgm/jdk1.5.0_09/jre/lib/i386:/usr/local/pgm/jdk1.5.0_09/jre/../lib/i386
Exception in thread "main" java.lang.UnsatisfiedLinkError: no foo in java.library.path
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1682)
at java.lang.Runtime.loadLibrary0(Runtime.java:822)
at java.lang.System.loadLibrary(System.java:993)
at Foo.main(Foo.java:7)
Afterwards, strace.txt contains:
[...]
stat64("/usr/local/pgm/jdk1.5.0_09/jre/lib/i386/libfoo.so", 0xfeffcc68) = -1 ENOENT
stat64("/usr/local/pgm/jdk1.5.0_09/jre/lib/i386/client/libfoo.so", 0xfeffcc68) = -1 ENOENT
stat64("/usr/local/pgm/jdk1.5.0_09/jre/lib/i386/libfoo.so", 0xfeffcc68) = -1 ENOENT
stat64("/usr/local/pgm/jdk1.5.0_09/jre/../lib/i386/libfoo.so", 0xfeffcc68) = -1 ENOENT
[...]
write(2, "Exception in thread \"main\" ", 27) = 27
write(2, "java.lang.UnsatisfiedLinkError: "..., 59) = 59
/gordon

Signature
[ don't email me support questions or followups ]
g o r d o n + n e w s @ b a l d e r 1 3 . s e
Krystian - 17 Nov 2006 13:00 GMT
> > When i load with System.load with full path to the library it is loaded
> > and works ok.
[quoted text clipped - 43 lines]
>
> /gordon
Thanks a lot!
strace on hp-ux is something totally different then on linux/bsd, but
Your log file gave me an answer! When i've changed the name to
libuxinfo.sl java loaded it and it works /well...kind of..i have to
change something in my C code ;) /
Best regards,
Krystian