简体   繁体   English

无法在Eclipse中设置共享库路径

[英]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.

相关问题 Eclipse Oxygen Installer无法找到配套共享库 - Eclipse Oxygen Installer unable to locate companion shared library iMac:Eclipse可执行启动程序无法找到其随播共享库 - iMac: The Eclipse executable launcher was unable to locate its companion shared library “eclipse 可执行启动器无法定位其配套共享库” - “The eclipse executable launcher was unable to locate its companion shared library” 如何将共享库文件添加到 Eclipse 中的 java.library.path 中? - How do I add a shared library file to the java.library.path in Eclipse? 无法启动Eclipse RCP应用程序产品-启动器无法找到其配套共享库 - Unable to launch Eclipse RCP application product - The Launcher was unable to locate its companion shared library 如何从 Eclipse 设置 java.library.path - How to set the java.library.path from Eclipse Eclipse设置的Ant Java构建路径在编译时缺少库 - Ant Java Build Path set by Eclipse is Missing a Library at Compile Time Cplex Java 库在Eclipse 中设置路径问题 - Cplex Java Library set up path problem in Eclipse 如何修复 Eclipse 可执行启动器无法找到 windows 7 的配套共享库? - How to fix the Eclipse executable launcher was unable to locate its companion shared library for windows 7? DRMAA和shared.library.path - DRMAA and the shared.library.path
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM