Tess4j unsatisfied link error on mac OS X

后端 未结 5 530
野趣味
野趣味 2020-12-10 18:24

Hey i am trying to use tess4j for tesseract and having this issue for eclipse on mac osx .

My tesseract is working fine from terminal but trying to run tess4j throug

5条回答
  •  春和景丽
    2020-12-10 18:39

    I had a very similar issue with Ghost4j, i.e.

    InvocationTargetException: Unable to load library 'gs': Native library (darwin/libgs.dylib) not found in resource path
    

    Instead of modifying jar files, point jna to the appropriate lib path by setting jna.library.path. In Eclipse, you need to set the system property in run configurations - SO answer for this here - https://stackoverflow.com/a/862405/2163229

    If you're using Maven exec:

    mvn -Djna.library.path=/opt/local/lib/ exec:java -Dexec.mainClass="foo.bar.NativeThingy"
    

    or

    export MAVEN_OPTS="-Djna.library.path=/opt/local/lib/" && mvn exec:java -Dexec.mainClass="foo.bar.NativeThingy"
    

    Obviously, set the path to wherever your libs are installed. In my case, I ran $ locate libgs.dylib and found the above path.

    References: https://jna.java.net/javadoc/com/sun/jna/NativeLibrary.html

提交回复
热议问题