1

My project invlolves calling a java function from C and vice versa. Hence I have used JNI. It works perfectly when I compile it from terminal. But I am facing problem when I try to use the same java file in eclipse IDE. I have tried to cmpile it in eclipse using a default package. It works perfectly. But the problem arises when I put in a package and then compile. I am getting the following error

Exception in thread "AWT-EventQueue-0" java.lang.UnsatisfiedLinkError: no my in java.library.path

For loading the shared library I have used the following command in java file

System.loadLibrary("my");

"libmy.so" is the name of the shared library which I generated from the terminal and is trying to use in eclipse

1
  • maybe you can try passing it as a VM argument. Something like -Djava.library.path=PATH_TO_LIB . I had a same problem with a MS JDBC .dll and i solved it this way. Hope it helps. Commented Jul 2, 2013 at 10:53

1 Answer 1

1

You will need to alter your eclipse run configuration for the program that is trying to use the shared library.

Try adding -Djava.library.path=/path/to/your/libary.so to the JVM arguments on the launcher

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.