在我的 64 位 Mac OSX 上尝试使用来自 java 项目的本机 C++ 库,正如此链接中所述:
https://github.com/bytedeco/javacpp-presets/tree/master/tesseract
但是当我运行示例时出现此错误,库 liblept.4.dylib 未加载,我不知道该怎么做。
java.lang.UnsatisfiedLinkError: no jnilept in java.library.path
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1865)
Caused by:java.lang.UnsatisfiedLinkError:/private/var/folders/h8/wpw5p9196v1dz0hcy_s66_5w0000gn/T/javacpp21146551279247/libjnilept.dylib: dlopen(/private/var/folders/h8/wpw5p9196v1dz0hcy_s66_5w0000gn/T/javacpp21146551279247/libjnilept.dylib, 1): Library not loaded: /Users/saudet/projects/bytedeco/javacpp-presets/leptonica/cppbuild/macosx-x86_64/lib/liblept.4.dylib
Referenced from: /private/var/folders/h8/wpw5p9196v1dz0hcy_s66_5w0000gn/T/javacpp21146551279247/libjnilept.dylib
更新:我尝试通过 mac 端口安装 tesseract 和 leptonica 库,此错误已消失,但出现新错误“java 无法写入核心转储,有问题的框架 leptonica..etc”
所以我删除了所有已安装的库再次返回相同的错误