错误net.sourceforge.tess4j.Tesseract-无法加载库'gs':在资源路径中找不到本机库(linux-x86-64 / libgs.so)

时间:2018-12-20 19:15:30

标签: linux ocr tesseract

<dependency>
    <groupId>net.sourceforge.tess4j</groupId>
    <artifactId>tess4j</artifactId>
    <version>3.2.1</version>
</dependency>

我在maven中使用以上依赖项。 在Java和Eclipse中使用。

由于我在Windows中安装了“ Visual Studio 2013的Visual C ++可再发行组件包”,因此我现在正在编译为可执行jar,并且它在Windows中执行时没有任何错误。

但是现在我想在linux机器上运行可执行jar。我收到以下错误:

错误net.sourceforge.tess4j.Tesseract-无法加载库'gs':在资源路径([file:/ MedEq / OCR / dme-ocr)中找不到本机库(linux-x86-64 / libgs.so) -0.0.1-SNAPSHOT-jar-with-dependencies.jar]) 请从http://sourceforge.net/projects/ghostscript/files下载并安装GPL Ghostscript 和/或设置适当的环境变量。 [pool-2-thread-2]错误net.sourceforge.tess4j.Tesseract-无法初始化类org.ghost4j.GhostscriptLibrary 请从http://sourceforge.net/projects/ghostscript/files下载并安装GPL Ghostscript 和/或设置适当的环境变量。 java.lang.RuntimeException:无法加载库'gs':在资源路径([file:/OCR/dme-ocr-0.0.1-SNAPSHOT-jar)中找不到本机库(linux-x86-64 / libgs.so) -with-dependencies.jar]) 请从http://sourceforge.net/projects/ghostscript/files下载并安装GPL Ghostscript 和/或设置适当的环境变量。         在net.sourceforge.tess4j.util.PdfUtilities.convertPdf2Tiff(PdfUtilities.java:55)         在net.sourceforge.tess4j.util.ImageIOHelper.getIIOImageList(ImageIOHelper.java:343)         在net.sourceforge.tess4j.Tesseract.doOCR(Tesseract.java:213)         在net.sourceforge.tess4j.Tesseract.doOCR(Tesseract.java:197)

1 个答案:

答案 0 :(得分:0)

在Linux上安装GhostScript,那样就可以了。

xAxes: [{ type: "CategoryAxis", dataFields: { category: "category" }, ... }, { type: "CategoryAxis", dataFields: { category: "total" }, ... }]