Skip to content

Homebrew installed Tesseract not detected by Tess4J #194

@nickjwhite

Description

@nickjwhite

Homebrew on OSX installs Tesseract in /usr/local/Cellar/tesseract/, and it puts symlinks for the libraries in /usr/local/lib. However it doesn't seem like JNI picks up the libraries in this location, with the error "Native library (darwin/libtesseract.dylib) not found in resource path".

I'm using VietOCR, so I temporarily fixed the issue by unpacking the .jar, and copying libtesseract.dylib into a darwin directory within it, and re-zipping it. However I think a better solution would be to use NativeLibrary.addSearchPath() to search for /usr/local/lib, as this is a common way of installing Tesseract on OSX.

I'm not very familiar with Java or OSX (I found this issue while helping someone else), so it's possible that there's a better way to do this, but the above suggested solution is the best I know of.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions