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/jre/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]

Reply via email to