编译程序时遇到问题。代码本身没有错误。
程序代码:
package plate;
import java.io.File;
import net.sourceforge.tess4j.Tesseract;
public class OcrReader {
public static void main(String[] args) throws Exception {
String inputFilePath = "C:\\Users\\Me\\eclipse-workspace\\platerecognition\\picture.tif";
Tesseract tesseract = new Tesseract();
String fullText = tesseract.doOCR(new File(inputFilePath));
System.out.println(fullText);
}
}
运行程序后的错误:
Exception in thread "main" java.lang.NoClassDefFoundError: com/sun/jna/Pointer
at plate.OcrReader.main(OcrReader.java:11)
Caused by: java.lang.ClassNotFoundException: com.sun.jna.Pointer
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 1 more