本文介绍了Tess4j问题java.lang.UnsatisfiedLinkError的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试解决Tess4J的安装问题,
1我已经在WEB-INF \ win32-x86
中创建了一个文件夹2,然后将libtesseract302.dll和liblept168.dll放在此处,并将其添加到Java构建路径中的source/native库中当我运行时,我发现了错误

I'm trying to solve the Tess4J installing problem ,
1 I had created a folder in WEB-INF\win32-x86
2 and I putted there the libtesseract302.dll and liblept168.dll and I add it to source/native library in the java build pathwhen I run I found the error

java.lang.UnsatisfiedLinkError: Unable to load library 'libtesseract302': Native library (win32-x86/libtesseract302.dll) not found in resource path ([file:/C:/Program%20Files/Apache%20Software%20Foundation/Tomcat%207.0/wtpwebapps/OCR/WEB-INF/classes/, file:/C:/Program%20Files/Apache%20Software%20Foundation/Tomcat%207.0/wtpwebapps/OCR/WEB-INF/lib/ghost4j-0.5.1.jar, file:/C:/Program%20Files/Apache%20Software%20Foundation/Tomcat%207.0/wtpwebapps/OCR/WEB-INF/lib/jai_imageio.jar, file:/C:/Program%20Files/Apache%20Software%20Foundation/Tomcat%207.0/wtpwebapps/OCR/WEB-INF/lib/jna-4.1.0.jar, file:/C:/Program%20Files/Apache%20Software%20Foundation/Tomcat%207.0/wtpwebapps/OCR/WEB-INF/lib/junit-4.10.jar, file:/C:/Program%20Files/Apache%20Software%20Foundation/Tomcat%207.0/wtpwebapps/OCR/WEB-INF/lib/log4j-1.2.17.jar, file:/C:/Program%20Files/Apache%20Software%20Foundation/Tomcat%207.0/wtpwebapps/OCR/WEB-INF/lib/tess4j.jar])
com.sun.jna.NativeLibrary.loadLibrary(NativeLibrary.java:271)
com.sun.jna.NativeLibrary.getInstance(NativeLibrary.java:398)
com.sun.jna.Library$Handler.<init>(Library.java:147)
com.sun.jna.Native.loadLibrary(Native.java:412)
com.sun.jna.Native.loadLibrary(Native.java:391)
net.sourceforge.tess4j.TessAPI.<clinit>(Unknown Source)
net.sourceforge.tess4j.Tesseract.init(Unknown Source)
net.sourceforge.tess4j.Tesseract.doOCR(Unknown Source)
net.sourceforge.tess4j.Tesseract.doOCR(Unknown Source)
net.sourceforge.tess4j.Tesseract.doOCR(Unknown Source)
ocrTest.doGet(ocrTest.java:39)
javax.servlet.http.HttpServlet.service(HttpServlet.java:620)
javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)

注意,我已经检查过我在使用

Note I had checked that I'm using 32 jvm with

System.out.println(System.getProperty("sun.arch.data.model"));

所以我确定
问题
如何解决此错误?
如果我在安装tess4j时出错,请告诉我如何?

so I'm sure
Questions
how to fix this error ?
if I made an error in setup tess4j please tell me how ?

推荐答案

我找到了解决方法
1 此处下载tesseract-ocr-setup-3.02.02.exe,然后安装
2 添加ghost4j-0.5.1.jarjai_imageio.jarjna-4.1.0.jarjunit-4.10.jarlog4j-1.2.17.jartess4j.jar来投影构建路径
并享受;)

I found the solution
1 download tesseract-ocr-setup-3.02.02.exe from here and install it
2 add the ghost4j-0.5.1.jar,jai_imageio.jar,jna-4.1.0.jar,junit-4.10.jar,log4j-1.2.17.jar and tess4j.jar to project the build path
and Enjoy ;)

这篇关于Tess4j问题java.lang.UnsatisfiedLinkError的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-02 20:05