[英]JNA java.lang.UnsatisfiedLinkError: Unable to load library './OUNPPM'
So, I have a project that uses a series of external C .dll
s and it works fine when running in Netbeans, but when I try to run the .jar
by itself, I get this error: 所以,我有一个使用一系列外部C
.dll
的项目,它在Netbeans中运行时工作正常,但是当我尝试.jar
运行.jar
,我收到此错误:
Exception in thread "Thread-3" java.lang.UnsatisfiedLinkError: Unable to load library './OUNPPM': The specified module could not be found.
线程“Thread-3”中的异常java.lang.UnsatisfiedLinkError:无法加载库'./OUNPPM':找不到指定的模块。
I've encountered this before for a few different reasons: 我之前遇到过这个问题有几个原因:
1) Not finding the file. 1)找不到文件。 2) Not finding another .dll that .dll is dependent on.
2)没有找到.dll依赖的另一个.dll。 3) Trying to load a 64-bit .dll with the 32-bit JRE (or vice versa)
3)尝试使用32位JRE加载64位.dll(反之亦然)
Is there any way to get a better error message to find out what is going on? 有没有办法得到更好的错误信息,以找出发生了什么? JNI gave better errors, but I'm not really at a place I can change those right now.
JNI给出了更好的错误,但我现在并不是真正能够改变这些错误的地方。
when you are launching the main class in your jar file, how are you running it and have you set your jna.library.path. 当您在jar文件中启动主类时,如何运行它并让您设置jna.library.path。
If your jna.library.path
points to the location of the correct dlls then you shoul dnot get those errors. 如果您的
jna.library.path
指向正确dll的位置,那么您应该不会得到这些错误。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.