Im using tess4j.jar in my Eclipse project. When i run it on eclipse my project is working fine, but when i try to run the exported runnable .jar file it always fails due to "java.lang.UnsatisfiedLinkError: Unable to load library 'libtesseract302'" error.
I tried to fix it with solutions from similar posts but nothing worked.
Error log:
Exception in thread "Thread-2" java.lang.UnsatisfiedLinkError: Unable to load library 'libtesseract302': Can't obtain InputStream for win32-x86/libtesseract302.dll
at com.sun.jna.NativeLibrary.loadLibrary(NativeLibrary.java:271)
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>(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 brain.Main.startOCR(Main.java:292)
at brain.Main.getOcrResult(Main.java:251)