Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Java don't load a library

Reply
Thread Tools

Java don't load a library

 
 
Andrea
Guest
Posts: n/a
 
      09-08-2005
I have to launch a java class wich load a library (Lpktgen). the library is
in the same directory of the .java file. why have I this error?:

[root@localhost codice]# java Ipktgen
Exception in thread "main" java.lang.UnsatisfiedLinkError: no Lpktgen in
java.li brary.path
at java.lang.ClassLoader.loadLibrary(ClassLoader.java :1517)
at java.lang.Runtime.loadLibrary0(Runtime.java:78
at java.lang.System.loadLibrary(System.java:834)
at Ipktgen.main(Ipktgen.java:6)

 
Reply With Quote
 
 
 
 
Gordon Beaton
Guest
Posts: n/a
 
      09-08-2005
On Thu, 08 Sep 2005 12:30:19 +0200, Andrea wrote:
> I have to launch a java class wich load a library (Lpktgen). the library is
> in the same directory of the .java file. why have I this error?:
>
> [root@localhost codice]# java Ipktgen
> Exception in thread "main" java.lang.UnsatisfiedLinkError: no Lpktgen in
> java.li brary.path


Set LD_LIBRARY_PATH so that it includes the directory containing the
library, or use -Djava.library.path.

/gordon

--
[ 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
 
Reply With Quote
 
 
 
 
Andrea
Guest
Posts: n/a
 
      09-08-2005
Gordon Beaton wrote:

> On Thu, 08 Sep 2005 12:30:19 +0200, Andrea wrote:
>> I have to launch a java class wich load a library (Lpktgen). the library
>> is in the same directory of the .java file. why have I this error?:
>>
>> [root@localhost codice]# java Ipktgen
>> Exception in thread "main" java.lang.UnsatisfiedLinkError: no Lpktgen in
>> java.li brary.path

>
> Set LD_LIBRARY_PATH so that it includes the directory containing the
> library, or use -Djava.library.path.
>
> /gordon
>

I'm sorry but I'm a Linux newbie which is the command to set the
LD_LIBRARY_PATH?
 
Reply With Quote
 
TechBookReport
Guest
Posts: n/a
 
      09-08-2005
Andrea wrote:
> Gordon Beaton wrote:
>
>
>>On Thu, 08 Sep 2005 12:30:19 +0200, Andrea wrote:
>>
>>>I have to launch a java class wich load a library (Lpktgen). the library
>>>is in the same directory of the .java file. why have I this error?:
>>>
>>>[root@localhost codice]# java Ipktgen
>>>Exception in thread "main" java.lang.UnsatisfiedLinkError: no Lpktgen in
>>>java.li brary.path

>>
>>Set LD_LIBRARY_PATH so that it includes the directory containing the
>>library, or use -Djava.library.path.
>>
>>/gordon
>>

>
> I'm sorry but I'm a Linux newbie which is the command to set the
> LD_LIBRARY_PATH?


You might find the following useful:
http://www.dynamic-apps.com/tutorials/classpath.jsp

Pan
--
TechBookReport Java: http://www.techbookreport.com/JavaIndex.html
 
Reply With Quote
 
Tor Iver Wilhelmsen
Guest
Posts: n/a
 
      09-08-2005
Andrea <> writes:

> I'm sorry but I'm a Linux newbie which is the command to set the
> LD_LIBRARY_PATH?


You can also set the java.library.path system property instead:

java -Djava.library.path=/path/to/dir YourApp
 
Reply With Quote
 
Roedy Green
Guest
Posts: n/a
 
      09-08-2005
On Thu, 08 Sep 2005 12:30:19 +0200, Andrea <>
wrote or quoted :

>java.lang.UnsatisfiedLinkError


One of my least favourite error messages, second only to
NoClassDefFoundError.

See
http://mindprod.com/jgloss/runerrorm...SFIEDLINKERROR

for hints on solving the problem.
--
Canadian Mind Products, Roedy Green.
http://mindprod.com Again taking new Java programming contracts.
 
Reply With Quote
 
Roedy Green
Guest
Posts: n/a
 
      09-08-2005
On 08 Sep 2005 16:49:40 +0200, Tor Iver Wilhelmsen
<> wrote or quoted :

>You can also set the java.library.path system property instead:
>
>java -Djava.library.path=/path/to/dir YourApp


Be careful with that approach. If anything ELSE is using the
java.library.path that code will stop working.

If you do it that way, I would use Wassup to find out the current
value of java.library.path and set it to a new value that includes the
current path.
--
Canadian Mind Products, Roedy Green.
http://mindprod.com Again taking new Java programming contracts.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
java.lang.UnsatisfiedLinkError: Can't load library from JNI code shivaraj Java 8 11-09-2009 09:45 AM
error: java.lang.UnsatisfiedLinkError: Can't load library: /home/nalgo01/libcImpl.so gopinath511 Software 0 01-07-2009 09:13 AM
System.load() & .loadLibrary() - with file not in java.library.path property billknop@gmail.com Java 4 03-28-2007 08:05 PM
Java native with RMI - cannot load the library Krystian Java 0 11-30-2006 08:30 AM
Calling a Managed C++ library which uses a load library function from a WS Sammy ASP .Net Web Services 1 08-18-2003 10:51 PM



Advertisments