简体   繁体   English

JNA UnsatisfiedLinkError异常

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

相关问题 Java JNA UnsatisfiedLinkError - Java JNA UnsatisfiedLinkError 异常UnsatisfiedLinkError - Exception UnsatisfiedLinkError Cassandra - 启动时遇到异常(java.lang.UnsatisfiedLinkError):找不到依赖库(jna626409071981896679.dll) - Cassandra - Exception (java.lang.UnsatisfiedLinkError) encountered during startup: Can't find dependent libraries( jna626409071981896679.dll) JNA-Ubuntu上的java.lang.UnsatisfiedLinkError - JNA - java.lang.UnsatisfiedLinkError on Ubuntu Windows,JNA:无法加载本机库-UnsatisfiedLinkError - Windows, JNA: Cannot load native library - UnsatisfiedLinkError JNA和C ++-导致UnsatisfiedLinkError的简约示例 - JNA and C++ - Minimalistic Example resulting in UnsatisfiedLinkError JNA 加载失败,UnsatisfiedLinkError,“拒绝访问” - JNA failing to load, UnsatisfiedLinkError, "Access Denied" Linux,JNA:liblo第二个方法调用上出现UnsatisfiedLinkError - Linux, JNA: UnsatisfiedLinkError on liblo second method call 在资源路径中找不到线程“主” java.lang.UnsatisfiedLinkError中的异常:jnidispatch(/ com / sun /jna/win32-x86/jnidispatch.dll) - Exception in thread “main” java.lang.UnsatisfiedLinkError: jnidispatch (/com/sun /jna/win32-x86/jnidispatch.dll) not found in resource path 从Linux上的.jar启动时,Java-JNA和共享库UnsatisfiedLinkError - Java - JNA and shared Libraries, UnsatisfiedLinkError when starting from a .jar on Linux
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM