Hi I have a problem using tess4j library with java. I´m using maven.
Exception in thread "main" java.lang.UnsatisfiedLinkError: Can not find the specified module.
I´m sure that the file setted in the path exist because the method exist returns true. The debuger show the problem in this instruction :
String result = instance.doOCR(imageFile);
This is the error:
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.TessAPI.<clinit>(TessAPI.java:45)
at net.sourceforge.tess4j.Tesseract.init(Tesseract.java:283)
at net.sourceforge.tess4j.Tesseract.doOCR(Tesseract.java:219)
at net.sourceforge.tess4j.Tesseract.doOCR(Tesseract.java:168)
at net.sourceforge.tess4j.Tesseract.doOCR(Tesseract.java:152)
at Index.main(Index.java:17)
My dependency
<dependency>
<groupId>net.sourceforge.tess4j</groupId>
<artifactId>tess4j</artifactId>
<version>1.3.0</version>
</dependency>
My code
import java.io.*;
import net.sourceforge.tess4j.*;
public class Index {
public static void main(String[] args) {
File imageFile = new File("C:\\Users\\Juan\\workspace\\TESSERACT\\src\\main\\java\\img.png");
Tesseract instance = Tesseract.getInstance(); //
try {
System.out.println( imageFile.exists());
String result = instance.doOCR(imageFile);
System.out.println(result);
} catch (TesseractException e) {
System.err.println(e.getMessage());
}
}
}
Thanks in advance.