UnsatisfiedLinkError - 有什么办法可以解决这个问题吗?

4
Exception in thread "main" java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader.main(JarRsrcLoader.java:58)
Caused by: com.melloware.jintellitype.JIntellitypeException: Could not load JIntellitype.dll from local file system or from inside JAR
    at com.melloware.jintellitype.JIntellitype.<init>(JIntellitype.java:114)
    at com.melloware.jintellitype.JIntellitype.getInstance(JIntellitype.java:174)
    at CaptureScreen.registerHotkeys(CaptureScreen.java:163)
    at CaptureScreen.<init>(CaptureScreen.java:100)
    at CaptureScreen.main(CaptureScreen.java:199)
    ... 5 more
Caused by: java.lang.UnsatisfiedLinkError: C:\Users\B\AppData\Local\Temp: Can't find    dependent libraries
    at java.lang.ClassLoader$NativeLibrary.load(Native Method)
    at java.lang.ClassLoader.loadLibrary0(Unknown Source)
    at java.lang.ClassLoader.loadLibrary(Unknown Source)
    at java.lang.Runtime.load0(Unknown Source)
    at java.lang.System.load(Unknown Source)
    at com.melloware.jintellitype.JIntellitype.<init>(JIntellitype.java:99)
    ... 9 more

当我从命令行运行程序时,会出现这个错误,但是在我的机器上运行程序并不会出现任何问题,然而,在其他人的机器上程序根本无法运行。我以前从未遇到过这种错误,感到相当困惑...尤其是它在两台机器上都会抛出这个错误,但只有在其他人的机器上无法运行程序。

2
JIntellitype库使用JNI调用JIntellitype.dll中的本地代码,但找不到该DLL。看起来该DLL被存储为jarfile资源,程序尝试在运行时将其解压缩到临时目录以从那里加载它,但出现了问题,文件实际上不存在。 - rob
2个回答

1
这是一个类路径错误。很可能你在编译时设置正确了,但在运行时没有设置好。请确保你的 jar 包在正确的位置,或者已经将其包含在类路径中。

1

访问Jintellitype网站,下载源代码,将其添加到您的下载文件夹中,然后在构建项目之后将.dll文件移动到Jitellitype类所在的文件夹中。


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接