Exception in thread "main" java.lang.UnsatisfiedLinkError: Unable to load library "libtesseract302": the specified module was not found

I am running Eclipse and I know that this is a common problem (trying to make some JNA), but all the fixes that I found on the Internet do not work:

  • The library is 32 bit, but when I get getProperty from sun.arch.data.model it is 32, so this is not a problem.
  • I tried putting my dll in the src folder, at the root of my eclipse project, but nothing works.
  • I tried doing System.setProperty ("jna.library.path", "c: /libtesseract302.dll"); and then putting your dll there, but that won't work.

Here is the code I'm using to try to include a native library:

public static final TessAPI INSTANCE = (TessAPI) Native.loadLibrary("libtesseract302", TessAPI.class); 
+4
source share
1 answer

do you need another dll, is this libtesseract302 dependency: "liblept168.dll" (can be found here: http://code.google.com/p/tesseract-ocr/source/browse/trunk/vs2008/lib/liblept168.dll? r = 553 )

try something like this:

put both dll files in the same folder (say tesseractlib)

in your code before loading the module add:

 System.setProperty("jna.library.path", "tesseractlib"); 

(By the way, you need to use 32-bit jvm, both libraries are 32-bit rather than 64-bit libraries and cannot be loaded into 64-bit jvm)

+7
source

Source: https://habr.com/ru/post/1488366/


All Articles