0

I'm developing a web app using Spring MVC with Maven and with some functionality using tess4j for the OCR.

My dev environment:

  • Eclipse Neon.3
  • os: win server 2008R2
  • jvm 64 bit
  • apache tomecat 9

I downloaded the latest version of Tess4J from http://tess4j.sourceforge.net/ and imported it into eclipse. I am following this URL, I followed all the steps but when I try to execute it I am getting the following error:

java.lang.UnsatisfiedLinkError: Le module spécifié est introuvable.

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:75)
at net.sourceforge.tess4j.TessAPI.<clinit>(TessAPI.java:42)
at net.sourceforge.tess4j.Tesseract.init(Tesseract.java:367)
at net.sourceforge.tess4j.Tesseract.doOCR(Tesseract.java:280)
at net.sourceforge.tess4j.Tesseract.doOCR(Tesseract.java:212)
at net.sourceforge.tess4j.Tesseract.doOCR(Tesseract.java:196)

I try to some tutorial and i add: .MV C++ 2015 Redistributable (x64) .I add on C:\Program Files (x86)\Apache Software Foundation\Tomcat 9.0\temp\tess4j\win32-x86-64

I still have the error.

kajede
  • 1
  • 1

1 Answers1

0

What is essentially happening is System is not able to find a native module called 'spécifié' (I think, I can't read French) to load. Now the mechanics is like this. during load time somewhere (probably in the jar) a call is being made like

System.loadLibrary("spécifié");

Which is failing because the native library is not on PATH. So a simple solution would be to put the module on PATH. If it is an Windows environment, then the module would be a DLL file called spécifié.dll. This file must be placed on the path (e.g. set PATH=C:\xyz\spécifié.dll).

Try it and check.

Ironluca
  • 3,402
  • 4
  • 25
  • 32
  • thanks for answer.i have set path in my code like this: public class test { public static void main(String[] args) { System.setProperty("jna.library.path", "src/main/resources/win32-x86-64"); File imageFile = new File("eurotext.tif"); ITesseract instance = new Tesseract(); try{ String result = instance.doOCR(imageFile); System.out.println(result); }catch(TesseractException e){ System.err.println(e.getMessage()); } } – kajede Sep 20 '17 at 14:12
  • Try to manually set the paths in a command prompt and execute your class with 'java' command. Alternately, if you are using eclipse, go to environment variables and set the path and then restart eclipse. Your problem is that the VM cannot find the files on the PATH, once that happens, it should work. – Ironluca Sep 20 '17 at 14:25
  • "Le module spécifé" means "The specified module"... It isn't *literally* looking for a module called "spécifié". – Jean-François Corbett Sep 20 '17 at 14:45