这是我的错误日志:
java.lang.UnsatisfiedLinkError:找不到指定的模块。
at com.sun.jna.Native.open(Native Method)
at com.sun.jna.NativeLibrary.loadLibrary(NativeLibrary.java:288)
at com.sun.jna.NativeLibrary.getInstance(NativeLibrary.java:427)
at com.sun.jna.Library$Handler.<init>(Library.java:179)
at com.sun.jna.Native.loadLibrary(Native.java:569)
at com.sun.jna.Native.loadLibrary(Native.java:544)
at net.sourceforge.tess4j.util.LoadLibs.getTessAPIInstance(Unknown Source)
at net.sourceforge.tess4j.TessAPI.<clinit>(Unknown Source)
at net.sourceforge.tess4j.Tesseract.init(Unknown Source)
at net.sourceforge.tess4j.Tesseract.doOCR(Unknown Source)
at net.sourceforge.tess4j.Tesseract.doOCR(Unknown Source)
at net.sourceforge.tess4j.Tesseract.doOCR(Unknown Source)
at Auto_Email.TC_10_DeleteEmail.OCR(TC_10_DeleteEmail.java:187)
at Auto_Email.TC_10_DeleteEmail.deleteEmail(TC_10_DeleteEmail.java:147)
at Auto_Email.TC_10_DeleteEmail.DeleteMail(TC_10_DeleteEmail.java:126)
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.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:85)
at org.testng.internal.Invoker.invokeMethod(Invoker.java:639)
at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:816)
at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1124)
at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:125)
at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:108)
at org.testng.TestRunner.privateRun(TestRunner.java:774)
at org.testng.TestRunner.run(TestRunner.java:624)
at org.testng.SuiteRunner.runTest(SuiteRunner.java:359)
at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:354)
at org.testng.SuiteRunner.privateRun(SuiteRunner.java:312)
at org.testng.SuiteRunner.run(SuiteRunner.java:261)
at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
at org.testng.TestNG.runSuitesSequentially(TestNG.java:1215)
at org.testng.TestNG.runSuitesLocally(TestNG.java:1140)
at org.testng.TestNG.run(TestNG.java:1048)
at org.testng.remote.AbstractRemoteTestNG.run(AbstractRemoteTestNG.java:126)
at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:152)
at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:57)
我添加了以下所有JAR文件: 公地IO-2.5 JAI-ImageIO的核心 - 1.3.1 JNA-4.4.0 JNA-平台4.4.0 七月至SLF4J-1.7.2 lept4j-1.6.0 的logback经典-1.2.3 的logback核-1.2.3 硒的服务器独立-2.7.0修补的来源 SLF4J-API-1.7.5 tess4j-3.4.0
请有人帮我解决这个问题.. 谢谢。答案 0 :(得分:0)
错误是由于未正确引用项目设置中所需的dll文件。对于eclipse中的tess4j项目,您可以在运行配置中为VM参数添加一行,您可以将dll文件放在一个“dll”中。在eclipse工作区中将文件夹保存在项目的根文件夹中:
-Djna.library.path = $ {workspace_loc:/ name_of_your_project} /动态链接库
对于64位运行时,dll文件是gsdll64.dll,liblept168.dll和libtesseract302.dll。 dll文件已经捆绑在win32文件夹的tess4j jar中,你可以提取并添加到你自己的dll文件夹中,如上所述。