java Jacob.jar 找不到 jacob-1.18-x86.dll

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/33919919/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-11-02 22:17:20  来源:igfitidea点击:

Jacob.jar cannot find jacob-1.18-x86.dll

javaautohotkeyjacob

提问by user3476534

I am trying to write Java code that uses autohotkey, specifically the autoitx4java implementation. I have the imports import java.text.SimpleDateFormat; import java.util.Date; import autoitx4java.AutoItX;As well as have added Jacob.jar, AutoItX4Java.jar and sqljdbc4.jar in the build path (sql jdbc is for other parts of the code). It doesn't compile because of an unsatisfied link error:

我正在尝试编写使用 autohotkey 的 Java 代码,特别是 autoitx4java 实现。我有导入 import java.text.SimpleDateFormat; import java.util.Date; import autoitx4java.AutoItX;以及在构建路径中添加了 Jacob.jar、AutoItX4Java.jar 和 sqljdbc4.jar(sql jdbc 用于代码的其他部分)。由于不满意的链接错误,它无法编译:

Exception in thread "main" java.lang.UnsatisfiedLinkError: no jacob-1.18-x86 in java.library.path at java.lang.ClassLoader.loadLibrary(Unknown Source) at java.lang.Runtime.loadLibrary0(Unknown Source) at java.lang.System.loadLibrary(Unknown Source) at com.jacob.com.LibraryLoader.loadJacobLibrary(LibraryLoader.java:184) at com.jacob.com.JacobObject.<clinit>(JacobObject.java:110) at autoitx4java.AutoItX.<init>(AutoItX.java:181) at MainTest.login(MainTest.java:126) at MainTest.setadmin(MainTest.java:181) at MainTest.runbasic(MainTest.java:21) at MainTest.main(MainTest.java:15)

Exception in thread "main" java.lang.UnsatisfiedLinkError: no jacob-1.18-x86 in java.library.path at java.lang.ClassLoader.loadLibrary(Unknown Source) at java.lang.Runtime.loadLibrary0(Unknown Source) at java.lang.System.loadLibrary(Unknown Source) at com.jacob.com.LibraryLoader.loadJacobLibrary(LibraryLoader.java:184) at com.jacob.com.JacobObject.<clinit>(JacobObject.java:110) at autoitx4java.AutoItX.<init>(AutoItX.java:181) at MainTest.login(MainTest.java:126) at MainTest.setadmin(MainTest.java:181) at MainTest.runbasic(MainTest.java:21) at MainTest.main(MainTest.java:15)

I have the jacob-1.18-x86.dll in the system32 folder (windows 8.1 is the OS) as well as jacob-1.18-x64.dll and jacob-1.18-M3-x64.dll, just in case it wanted to use the 64 bit dll. I tried adding C:/Windows/System32 to the jacob.jar "Native library location" (using eclipse) from some website, but that didn't work. Some other site suggested putting the dll in the C:\Program Files\Java\jre7\bin folder, so I did that, but it still throws the error. This code used to work on a different machine, but now it won't compile because of the unsatisfied link. I can't figure out where to put the jacob-1.18-x86 to get it to find it.

我在 system32 文件夹中有 jacob-1.18-x86.dll(Windows 8.1 是操作系统)以及 jacob-1.18-x64.dll 和 jacob-1.18-M3-x64.dll,以防万一它想使用64 位 dll。我尝试从某个网站将 C:/Windows/System32 添加到 jacob.jar“本机库位置”(使用 eclipse),但这没有用。其他一些站点建议将 dll 放在 C:\Program Files\Java\jre7\bin 文件夹中,所以我这样做了,但它仍然抛出错误。这段代码曾经在不同的机器上工作,但现在由于不满意的链接而无法编译。我不知道把 jacob-1.18-x86 放在哪里才能找到它。

回答by user3476534

Well, copied it into the "C:\Program Files (x86)\Java\jre1.8.0_65\bin" folder and it worked. Apparently it only looks there for the jacob dll's.

好吧,将它复制到“C:\Program Files (x86)\Java\jre1.8.0_65\bin”文件夹中,它就可以工作了。显然它只在那里寻找 jacob dll。