0

我有一个使用 Tess4j 的 Java Web 项目。在我的本地 Mac OS 上,它运行完美,因为可能我已经拥有从源代码构建的 Tesseract 和 Leptonica 库

./config, make, make install

现在我想将项目部署到远程 Linux 主机(私有 jvm),我创建了 war 文件并看到它包含 32 位和 64 位 linux 平台的各种 tesseract 和 leptonica jar 文件

mvn package -Dplatform.dependencies

但部署后我仍然收到此错误:

 .UnsatisfiedLinkError: Unable to load library 'tesseract': Native library (linux-x86-64/libtesseract.so) not found in resource path ([file:/home/jakarta/jvm/apache-tomcat-7.0.59/domains/yumq.nl/ocr1/WEB-INF/classes/, file:/home/jakarta/jvm/apache-tomcat-7.0.59/domains/yumq.nl/ocr1/WEB-INF/lib/aopalliance-1.0.jar, file:/home/jakarta/jvm/apache-tomcat-7.0.59/domains/yumq.nl/ocr1/WEB-INF/lib/commons-beanutils-1.8.3.jar, file:/home/jakarta/jvm/apache-tomcat-7.0.59/domains/yumq.nl/ocr1/WEB-INF/lib/commons-io-1.3.1.jar, file:/home/jakarta/jvm/apache-tomcat-7.0.59/domains/yumq.nl/ocr1/WEB-INF/lib/commons-logging-1.1.3.jar, file:/home/jakarta/jvm/apache-tomcat-7.0.59/domains/yumq.nl/ocr1/WEB-INF/lib/ghost4j-0.5.1.jar, file:/home/jakarta/jvm/apache-tomcat-7.0.59/domains/yumq.nl/ocr1/WEB-INF/lib/itext-2.1.7.jar, file:/home/jakarta/jvm/apache-tomcat-7.0.59/domains/yumq.nl/ocr1/WEB-INF/lib/jai-imageio-core-standalone-1.2-pre-dr-b04-2011-07-04.jar, file:/home/jakarta/jvm/apache-tomcat-7.0.59/domains/yumq.nl/ocr1/WEB-INF/lib/jna-4.1.0.jar, file:/home/jakarta/jvm/apache-tomcat-7.0.59/domains/yumq.nl/ocr1/WEB-INF/lib/log4j-1.2.15.jar, file:/home/jakarta/jvm/apache-tomcat-7.0.59/domains/yumq.nl/ocr1/WEB-INF/lib/platform-3.5.2.jar, file:/home/jakarta/jvm/apache-tomcat-7.0.59/domains/yumq.nl/ocr1/WEB-INF/lib/spring-aop-4.1.1.RELEASE.jar, file:/home/jakarta/jvm/apache-tomcat-7.0.59/domains/yumq.nl/ocr1/WEB-INF/lib/spring-beans-4.1.1.RELEASE.jar, file:/home/jakarta/jvm/apache-tomcat-7.0.59/domains/yumq.nl/ocr1/WEB-INF/lib/spring-context-4.1.1.RELEASE.jar, file:/home/jakarta/jvm/apache-tomcat-7.0.59/domains/yumq.nl/ocr1/WEB-INF/lib/spring-core-4.1.1.RELEASE.jar, file:/home/jakarta/jvm/apache-tomcat-7.0.59/domains/yumq.nl/ocr1/WEB-INF/lib/spring-expression-4.1.1.RELEASE.jar, file:/home/jakarta/jvm/apache-tomcat-7.0.59/domains/yumq.nl/ocr1/WEB-INF/lib/spring-web-4.1.1.RELEASE.jar, file:/home/jakarta/jvm/apache-tomcat-7.0.59/domains/yumq.nl/ocr1/WEB-INF/lib/spring-webmvc-4.1.1.RELEASE.jar, file:/home/jakarta/jvm/apache-tomcat-7.0.59/domains/yumq.nl/ocr1/WEB-INF/lib/tess4j-2.0.0.jar, file:/home/jakarta/jvm/apache-tomcat-7.0.59/domains/yumq.nl/ocr1/WEB-INF/lib/xmlgraphics-commons-1.4.jar])

这里有什么问题?我没有机会在这个远程主机上使用命令行,那么这里缺少什么以及如何安装必要的库?

4

1 回答 1

0

我不知道这些库,但从您的错误来看,您的 linux 似乎没有所需的二进制文件。

如果您在 Ubuntu 上,您可以尝试:

sudo apt-get install libtesseract-dev leptonica-progs
于 2015-06-20T19:51:27.463 回答