Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / September 2005

Tip: Looking for answers? Try searching our database.

JAR, JNI and libraries

Thread view: 
Marcelo - 30 Sep 2005 09:51 GMT
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.



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.