How Can i include a library inside a JAr file ?
I have a jar file like this:
>>jar ft prompt.jar
META-INF/
META-INF/MANIFEST.MF
Prompt.class
libPrompt.so
and the System.loadLibrary("Prompt");
but I get the error:
>> java -jar prompt.jar
Exception in thread "main" java.lang.UnsatisfiedLinkError: no Prompt 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:992)
at Prompt.<clinit>(Prompt.java:14)
help please
Marcelo
Gordon Beaton - 30 Sep 2005 10:11 GMT
> How Can i include a library inside a JAr file ?
> I have a jar file like this:
[quoted text clipped - 6 lines]
>
> and the System.loadLibrary("Prompt");
AFAIK your only option (someone please correct me otherwise) is to
copy the file from the jar to the local file system before attempting
to load it.
/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 - 30 Sep 2005 10:22 GMT
> >>jar ft prompt.jar
>META-INF/
[quoted text clipped - 3 lines]
>
>and the System.loadLibrary("Prompt");
I have done it with JAWS, but I don't know if it is legal otherwise.
With JAWS it is quite slick. You can put in BOTH a DLL for windows and
a libxxx.so for Linux and JAWS will load the correct one for the
platform. You tell JAWS what you have in a resource statement in your
JNLP file.
I would put Prompt in a package. libPrompt.so would NOT go in one.

Signature
Canadian Mind Products, Roedy Green.
http://mindprod.com Again taking new Java programming contracts.