Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added link to mac library to patch Tess4j on MacOS #246

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

EasyG0ing1
Copy link

@EasyG0ing1 EasyG0ing1 commented Feb 17, 2023

Hello,

I created a library that will help MacOS users patch their tess4j.jar file with the C library that comes with tesseract. This will help developers who wish to use your library on MacOS avoid the frustration of hunting down the error that gets thrown when trying to use this library.

I simply added a link to the README with a brief explanation.

@SERE026
Copy link

SERE026 commented Nov 7, 2023

Hello,
Mac M2 芯片运行报错,目前没有找到解决方案, 在命令行是可以直接识别图片的, java 中不行

Exception in thread "main" java.lang.UnsatisfiedLinkError: dlopen(/Users/apple/IdeaProjects/uds/uds-modules/uds-recognition/target/classes/libtesseract.dylib, 0x0009): tried: '/Users/apple/IdeaProjects/uds/uds-modules/uds-recognition/target/classes/libtesseract.dylib' (not a mach-o file), '/System/Volumes/Preboot/Cryptexes/OS/Users/apple/IdeaProjects/uds/uds-modules/uds-recognition/target/classes/libtesseract.dylib' (no such file), '/Users/apple/IdeaProjects/uds/uds-modules/uds-recognition/target/classes/libtesseract.dylib' (not a mach-o file)
	at com.sun.jna.Native.open(Native Method)
	at com.sun.jna.NativeLibrary.loadLibrary(NativeLibrary.java:298)
	at com.sun.jna.NativeLibrary.getInstance(NativeLibrary.java:483)
	at com.sun.jna.Library$Handler.<init>(Library.java:197)
	at com.sun.jna.Native.load(Native.java:622)
	at com.sun.jna.Native.load(Native.java:596)
	at net.sourceforge.tess4j.util.LoadLibs.getTessAPIInstance(LoadLibs.java:83)
	at net.sourceforge.tess4j.TessAPI.<clinit>(TessAPI.java:42)
	at net.sourceforge.tess4j.Tesseract.init(Tesseract.java:442)
	at net.sourceforge.tess4j.Tesseract.doOCR(Tesseract.java:238)
	at net.sourceforge.tess4j.Tesseract.doOCR(Tesseract.java:210)
	at com.uds.parser.OcrReader.main(OcrReader.java:28)

Process finished with exit code 1

@EasyG0ing1
Copy link
Author

EasyG0ing1 commented Jan 15, 2024

@SERE026

Update

The library has been updated, and now there is an executable program that you can get from the releases page on the repo where you can patch your Tess4J jar file easily. The program runs in Terminal and can be downloaded here

The program was compiled into a native-image using GraalVM.

@miaozhiyan
Copy link

@SERE026

Update

The library has been updated, and now there is an executable program that you can get from the releases page on the repo where you can patch your Tess4J jar file easily. The program runs in Terminal and can be downloaded here

The program was compiled into a native-image using GraalVM.

错误的类文件: /Users/mzy/.m2/repository/com/simtechdata/FixTess4j4Mac/2.0.0/FixTess4j4Mac-2.0.0.jar!/com/simtechdata/FixTess4j4Mac.class
类文件具有错误的版本 55.0, 应为 52.0

这是怎么回事呀?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants