java.lang.UnsatisfiedLinkError in tess4j

1,596 views
Skip to first unread message

Ankita Verma

unread,
Apr 27, 2015, 10:29:28 AM4/27/15
to tesser...@googlegroups.com
Hi, 
I am getting an error

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(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 com.app.ocr.TesseractExample.main(TesseractExample.java:17)

I have all the dlls in the classpath and the tessdata folder is in place.
Please help me regarding this.

Quan Nguyen

unread,
Apr 27, 2015, 7:46:40 PM4/27/15
to tesser...@googlegroups.com
Did you install Visual C++ Redistributable for VS2013? This seems to be the most common problem. Check the forum for answers.

Dattatraya Tembare

unread,
Jul 17, 2018, 1:49:09 PM7/17/18
to tesseract-ocr
I'm facing the same problem on Windows 10 with JDK 10 (same code is working in Windows 7 with JDK 8)
Error Logs: 

java.lang.UnsatisfiedLinkError: The specified module could not be found.



        at com
.sun.jna.Native.open(Native Method) ~[jna-4.5.2.jar!/:4.5.2 (b0)]
        at com.sun.jna.NativeLibrary.loadLibrary(NativeLibrary.java:288) ~[jna-4.5.2.jar!/:4.5.2 (b0)]
        at com.sun.jna.NativeLibrary.getInstance(NativeLibrary.java:427) ~[jna-4.5.2.jar!/:4.5.2 (b0)]
        at com.sun.jna.Library$Handler.<init>(Library.java:179) ~[jna-4.5.2.jar!/:4.5.2 (b0)]
        at com.sun.jna.Native.loadLibrary(Native.java:569) ~[jna-4.5.2.jar!/:4.5.2 (b0)]
        at com.sun.jna.Native.loadLibrary(Native.java:544) ~[jna-4.5.2.jar!/:4.5.2 (b0)]
        at net.sourceforge.tess4j.util.LoadLibs.getTessAPIInstance(LoadLibs.java:81) ~[tess4j-4.0.1.jar!/:4.0.1]
        at net.sourceforge.tess4j.TessAPI.<clinit>(TessAPI.java:42) ~[tess4j-4.0.1.jar!/:4.0.1]
        at net.sourceforge.tess4j.Tesseract.init(Tesseract.java:364) ~[tess4j-4.0.1.jar!/:4.0.1]
        at net.sourceforge.tess4j.Tesseract.doOCR(Tesseract.java:277) ~[tess4j-4.0.1.jar!/:4.0.1]
        at net.sourceforge.tess4j.Tesseract.doOCR(Tesseract.java:260) ~[tess4j-4.0.1.jar!/:4.0.1]
        at net.sourceforge.tess4j.Tesseract.doOCR(Tesseract.java:241) ~[tess4j-4.0.1.jar!/:4.0.1]
        at com.ea.ocr.tesseract.ReadImageText.ocrText(ReadImageText.java:143) ~[classes!/:18.07.02]
        at com.ea.ocr.data.GenerateData.getOcrText(GenerateData.java:663) ~[classes!/:18.07.02]
        at com.ea.ocr.data.GenerateData.voterCounts(GenerateData.java:299) ~[classes!/:18.07.02]
        at com.ea.ocr.data.GenerateData.generateJsonFile(GenerateData.java:123) ~[classes!/:18.07.02]
        at com.ea.ocr.controller.EaOcrController.generateJson(EaOcrController.java:35) ~[classes!/:18.07.02]
        at java.base/
jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na]
        at java
.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[na:na]
        at java
.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[na:na]
        at java
.base/java.lang.reflect.Method.invoke(Unknown Source) ~[na:na]

Dattatraya Tembare

unread,
Jul 17, 2018, 1:50:20 PM7/17/18
to tesseract-ocr
Forgot to mention, I have installed Visual C++ Redistributable for VS2013
Still how to check it, whether I have installed correct version?

Quan Nguyen

unread,
Jul 18, 2018, 7:48:35 AM7/18/18
to tesseract-ocr
That was old posts for older versions. You need VC++ 2015 at this time.

Btw, we haven't tested it with Java 10 yet. Will do that soon.

Thanks.

Quan Nguyen

unread,
Jul 18, 2018, 9:14:18 PM7/18/18
to tesseract-ocr
I've found the unit tests completed successfully with JDK 10 as well. So make sure you install the appropriate VC++ runtime.

Dattatraya Tembare

unread,
Jul 19, 2018, 8:42:28 AM7/19/18
to tesser...@googlegroups.com
Thanks Quan,
Will install latest VC++, test and let you know.

Datta

--
You received this message because you are subscribed to the Google Groups "tesseract-ocr" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tesseract-oc...@googlegroups.com.
To post to this group, send email to tesser...@googlegroups.com.
Visit this group at https://groups.google.com/group/tesseract-ocr.
To view this discussion on the web visit https://groups.google.com/d/msgid/tesseract-ocr/f36adcbe-cf06-422a-94da-fb030bbdea54%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
Best Regards,
Dattatraya Tembare

Dattatraya Tembare

unread,
Jul 19, 2018, 1:40:59 PM7/19/18
to tesser...@googlegroups.com
Hello Quan,
VC++ 2015 upgrade worked.

Thanks! again.
Reply all
Reply to author
Forward
0 new messages