问题描述
嘿,我正在尝试使用tess4j进行tesseract并在mac osx上使用此问题。
Hey i am trying to use tess4j for tesseract and having this issue for eclipse on mac osx .
我的tesseract从终端正常工作但试图运行tess4j tesseract会给我一个错误。
My tesseract is working fine from terminal but trying to run tess4j through tesseract throws me an error .
java.lang.UnsatisfiedLinkError:无法加载库'tesseract':本机库(darwin / libtesseract.dylib)
java.lang.UnsatisfiedLinkError: Unable to load library 'tesseract': Native library (darwin/libtesseract.dylib)
我在我使用macport安装的opt / local / lib中有tessetact dylib及其命名的libtesseract.dylib。
i do have tessetact dylib and its named libtesseract.dylib in my opt/local/lib which i installed using macport .
谢谢你你的帮助
推荐答案
我知道这是一篇旧帖子。我最近尝试使用 Tess4J
时遇到了这个问题。但是,我设法找到了解决方法。我写了一篇关于它的帖子
I know it's an old post. I had this problem too recently when I tried to use Tess4J
. However, I managed to find a way around it. I've written a post about it http://www.microshell.com/programming/java/performing-optical-character-recognition-in-java/
简而言之,问题是因为 tess4j-2.0.0.jar
不包括MacOS库。所以我只是通过以下步骤修改了我的maven缓存jar:
In short, the problem is because tess4j-2.0.0.jar
doesn't include MacOS library. So I just modified the maven cached jar on mine by doing these steps:
-
cd / Users / user /。 m2 / repository / net / sourceforge / tess4j / tess4j / 2.0.0
(调整tess4j JAR文件所在的目录) -
mkdir darwin
-
jar uf tess4j-2.0.0.jar darwin
-
cp /opt/local/lib/libtesseract.3.dylib darwin / libtesseract.dylib
-
jar uf tess4j-2.0.0.jar darwin / libtesseract.dylib
-
jar tf tess4j-2.0.0.jar
(验证文件是否包含在内)
cd /Users/user/.m2/repository/net/sourceforge/tess4j/tess4j/2.0.0
(adjust the directory where your tess4j JAR file resides)mkdir darwin
jar uf tess4j-2.0.0.jar darwin
cp /opt/local/lib/libtesseract.3.dylib darwin/libtesseract.dylib
jar uf tess4j-2.0.0.jar darwin/libtesseract.dylib
jar tf tess4j-2.0.0.jar
(to verify that the file is included)
我修改后能够运行我的Java程序 tess4j-2.0.0.jar
文件。下面是我的MacOS版本。
I was then able to run my Java program after I modify the tess4j-2.0.0.jar
file. Below is my MacOS version.
user@laptop:~$ uname -a
Darwin Maresas-MacBook-Pro.local 14.3.0 Darwin Kernel Version 14.3.0: Mon Mar 23 11:59:05 PDT 2015; root:xnu-2782.20.48~5/RELEASE_X86_64 x86_64
这篇关于Tess4j在mac OS X上不满意链接错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!