gpt4 book ai didi

java - UnsatisfiedLinkError:无法加载库

转载 作者:行者123 更新时间:2023-12-02 00:55:20 27 4
gpt4 key购买 nike

我创建了一个使用 autohotkey.dll 库的 jar 文件。 Jar 在我的主电脑和笔记本电脑上运行顺利,但现在我尝试在新安装了 Windows 10 的电脑上使用它,但收到此错误:

Exception in thread "main" java.lang.UnsatisfiedLinkError: Unable to load library 'AutoHotkey': Can't obtain InputStream for win32-x86-64/AutoHotkey.dll at com.sun.jna.NativeLibrary.loadLibrary(NativeLibrary.java:271) at com.sun.jna.NativeLibrary.getInstance(NativeLibrary.java:398) at com.sun.jna.Library$Handler.(Library.java:147) at com.sun.jna.Native.loadLibrary(Native.java:412) at com.sun.jna.Native.loadLibrary(Native.java:391) at DllController.(DllController.java:26) at UI.main(UI.java:113)

DLL 文件与 jar 文件位于同一文件夹中。

我尝试过以下方法:

  • 同时使用 32 位和 64 位版本的 JRE
  • 已安装 Visual C++ 可再发行软件包(32 位和 64 位)
  • 还尝试通过以下命令运行 jar:

java "-Djava.library.path=C:\runnablegui\new" -jar C:\runnablegui\new\as.jar

进程监视器中涉及 Autohotkey.dll 操作的屏幕截图: Screenshot from Process Monitor involving the Autohotkey.dll operations

最佳答案

问题已解决。我没有安装最新版本的 vc_redist

关于java - UnsatisfiedLinkError:无法加载库,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60415483/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com