[英]JNA UnsatisfiedLinkError exception
I am trying to deploy my application that invokes native calls using JNA library, but I get the following exception. 我正在尝试部署使用JNA库调用本机调用的应用程序,但是出现以下异常。 Exception in thread "main" java.lang.UnsatisfiedLinkError: Unable to load library 'myCustomDLL': Native library (win32-x86-64/myCustomDLL.dll) not found in resource path ([myproject/target/classes/, ...some jars...])
线程“主”中的异常java.lang.UnsatisfiedLinkError:无法加载库'myCustomDLL':在资源路径([myproject / target / classes /,...)中找不到本机库(win32-x86-64 / myCustomDLL.dll)一些罐子...])
What do I need to do in order to invoke the function correctly? 为了正确调用该函数,我需要做什么?
Any help much appreciated 任何帮助,不胜感激
You must put your dll library (with native code) on application java.library.path. 您必须将dll库(带有本机代码)放在应用程序java.library.path上。
See : http://examples.javacodegeeks.com/java-basics/java-library-path-what-is-it-and-how-to-use/ 参见: http : //examples.javacodegeeks.com/java-basics/java-library-path-what-is-it-and-how-to-use/
Edit: 编辑:
Post your project layout here. 在此处发布您的项目布局。 And how you run your app.
以及您如何运行应用程序。
Check whether the DLL is executable. 检查DLL是否可执行。 Check the dependant DLLs are all executable.
检查从属DLL是否都可执行。
With windows explorer, right click on DLL -> property -> security and verify execution rights. 使用Windows资源管理器,右键单击DLL->属性->安全并验证执行权限。
Actually I found the answer to this. 实际上,我找到了答案。 Basically, I needed to install Microsoft Visual C++ Redistributable package to install all the necessary DLLs needed for JNA to work.
基本上,我需要安装Microsoft Visual C ++可再发行组件包才能安装JNA运行所需的所有必需DLL。 Thanks for other responses to this question.
感谢您对此问题的其他答复。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.