Java don't load a library

A

Andrea

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:788)
at java.lang.System.loadLibrary(System.java:834)
at Ipktgen.main(Ipktgen.java:6)
 
G

Gordon Beaton

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
 
A

Andrea

Gordon said:
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?
 
T

TechBookReport

Andrea said:
Gordon Beaton 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
 
T

Tor Iver Wilhelmsen

Andrea said:
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
 
R

Roedy Green

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,053
Latest member
BrodieSola

Latest Threads

Top