我剛剛從http://tess4j.sourceforge.net/下載了Tess4J,並將其導入到netbeans中。我正在follwoing this url我遵循每一步正確,但是當我試圖執行我得到以下錯誤。java.lang.UnsatisfiedLinkError:無法找到指定的模塊
錯誤:
Exception in thread "main" java.lang.UnsatisfiedLinkError: The specified module could not be found.
at com.sun.jna.Native.open(Native Method)
at com.sun.jna.Native.open(Native.java:1759)
at com.sun.jna.NativeLibrary.loadLibrary(NativeLibrary.java:260)
at com.sun.jna.NativeLibrary.getInstance(NativeLibrary.java:398)
at com.sun.jna.Library$Handler.<init>(Library.java:147)
at com.sun.jna.Native.loadLibrary(Native.java:412)
at com.sun.jna.Native.loadLibrary(Native.java:391)
at net.sourceforge.tess4j.util.LoadLibs.getTessAPIInstance(LoadLibs.java:75)
at net.sourceforge.tess4j.TessAPI.<clinit>(TessAPI.java:42)
at net.sourceforge.tess4j.Tesseract.init(Tesseract.java:367)
at net.sourceforge.tess4j.Tesseract.doOCR(Tesseract.java:280)
at net.sourceforge.tess4j.Tesseract.doOCR(Tesseract.java:212)
at net.sourceforge.tess4j.Tesseract.doOCR(Tesseract.java:196)
at recognizer.Recognizer.main(Recognizer.java:17)
Java Result: 1
我搜索,發現人們所提出的建議更新到Visual Visual C++ Redistributable Packages for Visual Studio 2013我做到了,但事實證明沒有幫助,我仍然得到同樣的問題。我不知道我在下面做錯了什麼是我的代碼。
代碼:
import java.io.*;
import net.sourceforge.tess4j.*;
public class Recognizer {
public static void main(String[] args) {
File imageFile = new File("image.jpg");
Tesseract instance = new Tesseract();//
try {
String result = instance.doOCR(imageFile);
System.out.println(result);
} catch (TesseractException e) {
System.err.println(e.getMessage());
}
}
}
[最新版本](http://tess4j.sourceforge.net/usage.html)需要Visual C++ 2015可再發行組件包。 – nguyenq
@nguyenq我試過仍然我得到同樣的錯誤。 – animal
沒有解決方法嗎? :/我有同樣的問題 – Juan