[英]Unable to set shared library path in eclipse
My project invlolves calling a java function from C and vice versa. 我的项目涉及从C调用Java函数,反之亦然。 Hence I have used JNI.
因此,我使用了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.
但是当我尝试在Eclipse IDE中使用相同的Java文件时遇到了问题。 I have tried to cmpile it in eclipse using a default package.
我试图使用默认程序包在Eclipse中进行编译。 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 线程“ AWT-EventQueue-0”中的异常java.lang.UnsatisfiedLinkError:java.library.path中没有my
For loading the shared library I have used the following command in java file 为了加载共享库,我在java文件中使用了以下命令
System.loadLibrary("my"); 的System.loadLibrary( “我”);
"libmy.so" is the name of the shared library which I generated from the terminal and is trying to use in eclipse “ libmy.so”是我从终端生成并试图在eclipse中使用的共享库的名称
You will need to alter your eclipse run configuration for the program that is trying to use the shared library. 您将需要为尝试使用共享库的程序更改Eclipse运行配置。
Try adding -Djava.library.path=/path/to/your/libary.so
to the JVM arguments on the launcher 尝试将
-Djava.library.path=/path/to/your/libary.so
到启动器上的JVM参数中
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.