I've experienced the same problem before. Try
System.load("/home/srcd/foo/libJLinkNativeLibrary.so");

This works for me, although I think the System.loadLibrary()
should work at the first place.

Sheng-Yih.

----- Original Message -----
From: Solomon Douglas <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, August 28, 1999 6:41 PM
Subject: loading shared libraries


> I'm having trouble loading a JNI library from a nonstandard location.
> I'm using the following code:
>
>   static {
>     System.setProperty("java.library.path",
>                        System.getProperty("java.library.path") +
>                        ":/home/srcd/foo");
>     System.err.println(System.getProperty("java.library.path"));
>     System.loadLibrary("JLinkNativeLibrary");
>   }
>
> (The library is "/home/srcd/foo/libJLinkNativeLibrary.so").
>
> The output of my program is this:
>
>
/usr/local/Java/jdk1.2/jre/lib/i386/native_threads:/usr/local/Java/jdk1.2/jr
e/lib/i386/classic:/usr/local/Java/jdk1.2/jre/lib/i386:/home/srcd/foo
> Exception in thread "main" java.lang.UnsatisfiedLinkError: no
JLinkNativeLibrary in java.library.path
> at java.lang.ClassLoader.loadLibrary(Compiled Code)
> at java.lang.Runtime.loadLibrary0(Compiled Code)
> at java.lang.System.loadLibrary(Compiled Code)
> at TestJLink.<clinit>(TestJLink.java:18)
>
> So, as you can see, even if I set the value of the java.library.path
> property before calling System.loadLibrary, it doesn't find the file.
> Is there something I need to do to ask loadLibrary to rescan the value
> of the java.library.path property before trying to find the file?
>
> (Blackdown 1.2 pre-v2, RedHat 6.0.)
>
> Thanks,
>
> Solomon
> --
>  Solomon <|>   [EMAIL PROTECTED]
>  Douglas /|\   http://web.mit.edu/srcd/www/
>
>
> ----------------------------------------------------------------------
> To UNSUBSCRIBE, email to [EMAIL PROTECTED]
> with a subject of "unsubscribe". Trouble? Contact
[EMAIL PROTECTED]
>


----------------------------------------------------------------------
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to