nguyenq / tess4j

Java JNA wrapper for Tesseract OCR API
Apache License 2.0
1.58k stars 372 forks source link

Building own Jar for Linux and Macos #226

Closed roflox closed 2 years ago

roflox commented 2 years ago

Hello,

I am trying to create a single Jar file that would contain all necessary dll, so and dylib files so that I can deploy it cross-platform without the need to install Tesseract or Leptonica. I am running into some problems when I try to package Linux libraries. This is my resources folder: image

But when I try to run on my Linux VM mvn package

I get this: image

Could you please navigate me what should I do to be able to create one such JAR file? Thank you for your time.

Best regards

nguyenq commented 2 years ago

Regarding the correct library name and folder, please consult JNA code to verify.

https://github.com/java-native-access/jna/blob/master/src/com/sun/jna/Platform.java https://github.com/java-native-access/jna/blob/master/src/com/sun/jna/NativeLibrary.java

But the locale error seems to point to something else, not the location.

When you build Leptonica, make sure it includes all the necessary dependencies (tiff, png, jpeg, etc.).