> I am using MAC OSX 10.4 (imac G5).
[...]
> System.loadLibrary("xxx");
[...]
> For all the above cases I am getting following exception..
> iMac:/Library/Java/Extensions root# appletviewer Test.htm
> JNINetDirect instance created
> java.lang.UnsatisfiedLinkError:
> /Library/Java/Extensions/libNetDirect.jnilib:
> at java.lang.ClassLoader$NativeLibrary.load(Native Method)
[...]
> The same code if I make it as Java Application it is running
> fine....Any idea?
Was it really necessary to post this to 5 newgroups? Any why do you
think it belongs in an advocacy group? If you really think you need to
post to more than one group, at least learn to *crosspost* properly
and try to show some restraint.
Some questions for you:
1. Is the name of the library really libxxx.jnilib, or is it
actually libNetDirect.jnilib? Please don't obfuscate the
library name if that's what you're doing, it makes it harder
to interpret the error message. Which library is failing?
2. What is the value of java.library.path
a: when it works
b: when it doesn't
3. Does it work if you use
System.load("/actual/path/to/library/libxxx.jnilib");
instead? (I don't suggest this as a solution, but the answer
may help to find out why it's failing)
4. Does the library have runtime dependencies on other libraries?
/gordon

Signature
[ do not email me copies of your followups ]
g o r d o n + n e w s @ b a l d e r 1 3 . s e
Roedy Green - 19 Oct 2005 04:47 GMT
>Was it really necessary to post this to 5 newgroups? Any why do you
>think it belongs in an advocacy group? If you really think you need to
>post to more than one group, at least learn to *crosspost* properly
>and try to show some restraint.
see http://mindprod.com/jgloss/multipost.html
http://mindprod.com/jgloss/crosspost.html
to understand the sins you are being accused of.

Signature
Canadian Mind Products, Roedy Green.
http://mindprod.com Again taking new Java programming contracts.
> I am using MAC OSX 10.4 (imac G5).
> I am trying to load a JNI library libxxx.jnilib through an applet.
...
> For all the above cases I am getting following exception..
> iMac:/Library/Java/Extensions root# appletviewer Test.htm
> JNINetDirect instance created
> java.lang.UnsatisfiedLinkError:
...
> The same code if I make it as Java Application it is running
> fine....Any idea?
Security? What security environment does the Macintosh
Applet Viewer impose?
Do you swallow exceptions?
<http://www.physci.org/codes/javafaq.jsp#stacktrace>
I suspect you have a SecurityException/AccessControlException
causing the UnsatisfiedLinkError, hidden somewhere in the code
you did not show..