JNI Problem

M

Marcelo

I would like to know what happens here....
In one computer (terminal) the program executes as normal, but in
another computer (terminal with ssh connection) it doesnt work anymore.
The message that I have is:

The library that I use for the JNI program is called libPrompt.so,
the command line that I use to compile this shared library is:
g++ Prompt.c -Wno-deprecated -shared -fpic -o libPrompt.so

Can anybody help me?

Exception in thread "main" java.lang.UnsatisfiedLinkError:
/home/mmfernan/workspace/Prompt/libPrompt.so:
/home/mmfernan/workspace/Prompt/libPrompt.so: cannot open shared object
file: No such file or directory at
java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1676)
at java.lang.Runtime.loadLibrary0(Runtime.java:822)
at java.lang.System.loadLibrary(System.java:992)
at Prompt.<clinit>(Prompt.java:13)
 
T

Thomas Fritsch

Marcelo said:
I would like to know what happens here.... [...]
Exception in thread "main" java.lang.UnsatisfiedLinkError:
/home/mmfernan/workspace/Prompt/libPrompt.so:
/home/mmfernan/workspace/Prompt/libPrompt.so: cannot open shared object
file: No such file or directory
at java.lang.ClassLoader$NativeLibrary.load(Native Method) [...]
at Prompt.<clinit>(Prompt.java:13)
Your JVM searched for "libPrompt.so", but didn't find it.
You can check where the JVM actually looks for *.so libraries by doing
System.out.println(System.getProperty("java.library.path");
somewhere in your code. You'll get a list of directories (separated by
":" on Linux/Unix, by ";" on Windows). You have to put your *.so library
into one of the directories given there.
 

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

Similar Threads

JNI UnsatisfiedLinkError 11
JNI question 1
JNI:"undefined symbol" in "shared-library" 2
JNI Programming 19
JAR, JNI and libraries 2
JNI (Java - C++) 3
JNI: shared library has undefined symbol 1
JNI on Redhat Linux 4

Members online

No members online now.

Forum statistics

Threads
473,968
Messages
2,570,154
Members
46,702
Latest member
LukasConde

Latest Threads

Top