Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UnsatisfiedLinkError - Unable to load library - Native library not found in resource path

I have the following error at runtime, while trying to run Tess4J:

Exception in thread "main" java.lang.UnsatisfiedLinkError: Unable to load library 'libtesseract302': Native library (win32-x86-64/libtesseract302.dll) not found in resource path ([myproject/target/classes/, ...some jars...])

My questions are:

1) What exactly it tries to find and where?

2) Why is it apparently searches for myproject/target/classes/ directory? I set it nowhere.

3) Why is it ignores "native directory path" I set for tess4j.jar in user library descripto in Eclipse? My DLLs are there. If it didn't ignore the path, it would find DLLs.

4) Why is it apparently prepending DLL name with win32-x86-64/? I set this nowhere. Is this standard prefix of some API?

5) What is "resource path"? How to set it?

like image 366
Suzan Cioc Avatar asked Nov 04 '13 13:11

Suzan Cioc


People also ask

What is Djava library path?

java. library. path is a System property, which is used by Java programming language, mostly JVM, to search native libraries, required by a project.


1 Answers

I think an easier way to get around this error would be to revert to an earlier version where you were not getting this error. Right click on the project folder and navigate to local history to revert to an earlier version. I verified this workaround on the android studio installed on Mac OS Big sur.

like image 186
user4540741 Avatar answered Sep 23 '22 20:09

user4540741