Bookmark Topic Watch Topic
  • New Topic

Problem loading Libraries JNI

 
Sri Harsha Yenuganti
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Report post to moderator
I am trying to use JNI calls to C library in UNIX environment. I tried to run a simple hello world application using

java -Djava.library.path=. com.fedex.jni.Hello

I have the "libHello_JNI.so" library in the current directory. But why is it still complaining

Exception in thread "Main Thread" java.lang.UnsatisfiedLinkError: no Hello_JNI in java.library.path
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1682)
at java.lang.Runtime.loadLibrary0(Runtime.java:823)
at java.lang.System.loadLibrary(System.java:1030)
at com.fedex.jni.Hello.<clinit>(Hello.java:6)

I have tried setting the LD_LIBRARY_PATH to the directory containing "libHello_JNI.so". Even that did not work !!
Can anyone help me ?
 
Rob Spoor
Sheriff
Posts: 20817
68
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Report post to moderator
Please Use One Thread Per Question. Let's continue here.
 
    Bookmark Topic Watch Topic
  • New Topic
Boost this thread!