不满意的链接错误帮助 Java JNI Eclipse
您好,我正在尝试在 Eclipse 中运行一个项目,但收到运行时错误:
Exception in thread "main" java.lang.UnsatisfiedLinkError: mywrapperclass.nativemethod()V
我仅在调用包装器中的本机方法时收到错误代码我的主课。我浏览了许多论坛和博客/网站,但无法解决此问题。调试和浏览让我认为问题在于项目无法找到 dll 中的本机方法。
我在让 eclipse 找到 .dll 时遇到了很多麻烦,最终通过将 dll 放在 system32 文件夹中解决了这个问题。
提前致谢
Hi I am trying to run a project in eclipse and am getting the runtime error:
Exception in thread "main" java.lang.UnsatisfiedLinkError: mywrapperclass.nativemethod()V
I only get the error code when I call a native method in the wrapper class from my main. I have looked around on many forums and blogs/websites and haven't been able to fix this. Debug and my browsing have me led me to thinking that the problem lies in the project not being able to find the native methods within the dll.
I had a lot of trouble getting eclipse to find the .dll and eventually solved this by placing the dll in the system32 folder.
Thanks in advance
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
将 dll 与 eclipse 插件捆绑在一起的最简单方法是
在插件下创建一个文件夹结构,例如 x86 架构的“os/win32/x86”,并将 dll 放置在那里。
并在插件代码中加载这样的库 System.loadLibrary("Dll name");
Easiest way to bundle the dlls with eclipse plugin is
create a folder structure under the plugin like this "os/win32/x86" for x86 architecture and place your dlls there.
and load the libraries like this in your plugin code System.loadLibrary("Dll name");
单击需要 DLL 库的 JAR 的箭头。
您必须指定 DLL 库的位置。
Click on the arrow of the JAR that needs the DLL library.
You have to specify the location of the DLL library.