I have configured tess4j test application as http://tess4j.sourceforge.net/tutorial/.
But when I run the project, it gives this error:
Exception in thread "main" java.lang.UnsatisfiedLinkError: Can't obtain updateLastError method for class com.sun.jna.Native
at com.sun.jna.Native.initIDs(Native Method)
at com.sun.jna.Native.<clinit>(Native.java:148)
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 tstest.Main.main(Main.java:22)
Java Result: 1
I am unable to find any comments related to tesseract, If anyone have done in this project please help.
This is the example code I am using:
import java.io.*;
import net.sourceforge.tess4j.*;
public class Main {
public static void main(String[] args) {
File imageFile = new File(System.getProperty("user.dir") + "\\images\\1.png");
Tesseract instance = Tesseract.getInstance(); //
try {
String result = instance.doOCR(imageFile);
System.out.println(result);
} catch (TesseractException e) {
System.err.println(e.getMessage());
}
}
}