tess4j icon indicating copy to clipboard operation
tess4j copied to clipboard

Added link to mac library to patch Tess4j on MacOS

Open EasyG0ing1 opened this issue 2 years ago • 3 comments

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.

EasyG0ing1 avatar Feb 17 '23 18:02 EasyG0ing1

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

SERE026 avatar Nov 07 '23 14:11 SERE026

@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.

EasyG0ing1 avatar Jan 15 '24 18:01 EasyG0ing1

@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

这是怎么回事呀?

miaozhiyan avatar Apr 10 '24 12:04 miaozhiyan