west007
west007

Reputation: 97

Unable to set shared library path in eclipse

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

Upvotes: 1

Views: 525

Answers (1)

DaveH
DaveH

Reputation: 7335

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

Upvotes: 1

Related Questions