nguyenq / tess4j

Java JNA wrapper for Tesseract OCR API
Apache License 2.0
1.58k stars 372 forks source link

UnsatisfiedLinkError: The specified module could not be found #95

Closed nobleson closed 5 years ago

nobleson commented 6 years ago

I have gradually followed this document example, using netbeans. http://tess4j.sourceforge.net/tutorial/
My System configuration is as follow: Windows 7 64bit. JDK 1.8 Microsoft visual c++ 2015 86x already existed so i installed 2017 64bit also. I have also find and downloaded all the required jar files as you can see. commons-io-2.5.jar jai-imageio-core-1.3.1.jar jna-4.1.0.jar jul-to-slf4j-1.8.0-beta2.jar lept4j-1.10.0.jar logback-classic-1.1.3.jar logback-core-1.1.3.jar slf4j.jar tess4j-4.0.2.jar

I also added the testdata folder but i got this error

run: 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(LoadLibs.java:84)
at net.sourceforge.tess4j.TessAPI.<clinit>(TessAPI.java:42)
at net.sourceforge.tess4j.Tesseract.init(Tesseract.java:364)
at net.sourceforge.tess4j.Tesseract.doOCR(Tesseract.java:277)
at net.sourceforge.tess4j.Tesseract.doOCR(Tesseract.java:209)
at net.sourceforge.tess4j.Tesseract.doOCR(Tesseract.java:193)
at tess4j.example.TesseractExample.main(TesseractExample.java:27)

Please i need help.

nguyenq commented 5 years ago

The problem seems to have been fixed by compiling the DLL not using Enhanced Instruction Set.

mk-reddy commented 5 years ago

This issue seems to be resolved after upgrading the dependent jars to latest versions. Attaching a screen shot of the jars used as i am not sure which has solved the issue(maybe the jna.jar version). Followed the tutorial @ http://tess4j.sourceforge.net/tutorial/. UnlinkError

vipulpatel2103 commented 4 years ago

Hi @nguyenq, Currently, we are using below Gradle dependencies. Some AWS EC2 instances are causing this issue. Which version of tess4j has a fix to support both AVX and non-AVX CPUs?

vipulpatel2103 commented 4 years ago

Issue resolved after install "VC++ 2017 redistributable package x64". Just to update.

nouhoum-ibrahim-traore commented 4 years ago

Hello everybody. I am using Tess4j in Java SDK version 1.8.0_251 under Intellij Idea. I solved the UnsatisfiedLinkError... using the version 3.4.8 of Tess4j. You can find it online. Or if you want here is the link of the folder of jars I used : https://drive.google.com/file/d/1bAk9ioTHERX0_VMR0INw2I6QRD5iO3Rl/view?usp=sharing Hope it will help you

pengsili commented 4 years ago

Hello Everyone, Seems this issue happen again in tess4j 4.5.1. And i checked my CPU, it should support AVX.Then i change to use tess4j 4.4.0 and it is ok.Thanks image

nguyenq commented 4 years ago

@pengsili You have VC++ 2019 redistributable package x64 installed?

amankumarmonga09 commented 4 years ago

I have tried multiple Tess4j versions (from 4.4.0 to 4.5.0) but ended with same error. Then finally I agreed to above comment of installing VC++ 2015-2019 and finally resolved the issue now. image

image

mahmoud19901990 commented 3 years ago

I am reproducing the issue with tess4j 4.5.4 and lept4j 1.14.0, I have installed the latest VC C++ versions:

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.(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(LoadLibs.java:85) at net.sourceforge.tess4j.TessAPI.(TessAPI.java:42) at net.sourceforge.tess4j.Tesseract.init(Tesseract.java:427) at net.sourceforge.tess4j.Tesseract.doOCR(Tesseract.java:223) at net.sourceforge.tess4j.Tesseract.doOCR(Tesseract.java:195) at com.java.nadeem.app.ocr.TesseractExample.main(TesseractExample.java:24)

image

image

image

image

Please note that using tess4j 4.4.1 it works fine but I want to use the newer version

nguyenq commented 3 years ago

@mahmoud19901990 Try with lept4j-1.13.2 dependency.

AlexBravo95 commented 3 years ago

Estoy presentando el mismo problema en la version >4.5.4 pero para windows server 2019 en mi local funciona bien

jixxed commented 2 years ago

I had some of my clients experiencing this issue. because I ran from IDE, the files got extracted. The clients that used a packaged javafx exe, did not get the files extracted. I believe it has something to do with the method of how to get resources. The Some.class.getResourceAsStream("path") always works for me.

vivek2314 commented 1 year ago

Hello everybody. I am using Tess4j in Java SDK version 1.8.0_251 under Intellij Idea. I solved the UnsatisfiedLinkError... using the version 3.4.8 of Tess4j. You can find it online. Or if you want here is the link of the folder of jars I used : https://drive.google.com/file/d/1bAk9ioTHERX0_VMR0INw2I6QRD5iO3Rl/view?usp=sharing Hope it will help you

Thanks after 3 hrs i'll able to find solutions.