2

我正在尝试在 64 位 Windows 上执行GROBID 。

没有适用于 Windows 的库的 x64 位版本(至少我找不到)。它在带有 64 位 JRE 的 64 位 Linux 和带有 32 位 JRE 的 32 位 Windows 上运行。所以JRE的版本不是问题。

我了解我需要包含 64 位 Windows - libcrfpp 文件。但是我找不到它。你能告诉我在哪里可以找到它或帮助我执行它吗?

但是我收到如下错误 -

尝试在 Windows 64 上使用 64 位 JVM 运行它时出错 -

Exception in thread "main" java.lang.ExceptionInInitializerError
        at org.grobid.core.main.GrobidParser.<clinit>(GrobidParser.java:22)
        at org.pushpin.main.Main.main(Main.java:138)
   Caused by: java.lang.RuntimeException: Unable to find a native CRF++ library: Folder <FOLDER>\GROBID_HOME\.\lib\win-64 does not exist
        at org.grobid.core.main.LibraryLoader.load(LibraryLoader.java:21)
        at org.grobid.core.impl.GrobidFactoryImpl.init(GrobidFactoryImpl.java:35)
        at org.grobid.core.impl.GrobidFactoryImpl.newInstance(GrobidFactoryImpl.java:22)
        at org.grobid.core.impl.GrobidFactoryImpl.instance(GrobidFactoryImpl.java:14)
        at org.grobid.core.GrobidFactory.<clinit>(GrobidFactory.java:13)
        ... 2 more

尝试在 Windows 64 上使用 32 位 JVM 运行它时出现更新错误 -

Caused by: java.io.IOException: Cannot run program "<project path i have removed it>\lib/pdftoxml": CreateProcess error=193, %1 is not a valid Win32 application
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029)
at java.lang.Runtime.exec(Runtime.java:615)
at java.lang.Runtime.exec(Runtime.java:448)
at java.lang.Runtime.exec(Runtime.java:345)
at org.grobid.core.document.Document.pdf2xml(Document.java:217)
at org.grobid.core.engines.HeaderParser.processing(HeaderParser.java:86)
4

2 回答 2

2

无法从 64 位 JVM 加载 32 位本机库。

但是您可以在 64 位 Windows 上安装 32 位 JVM 并运行使用 32 位本机库的 Java 应用程序。

更新:

这是应用程序启动器的摘录

private static String getLibraryFolder() {
    String osPart = System.getProperty("os.name").replace(" ", "").toLowerCase().substring(0, 3);
    String archPart = System.getProperty("sun.arch.data.model");
    //todo: change to fetching the basic dir from GrobidProperties object
    return String.format("%s/%s-%s", GrobidProperties.getInstance().getNativeLibraryPath().getAbsolutePath(),
            osPart, archPart);
}

应用程序正在检查属性sun.arch.data.model以获取本机库文件夹。如果你在 64 位 Windows 中使用 32 位 JVM,你会得到

java.home=C:\Program Files (x86)\Java\jre7
os.arch=x86
os.name=Windows 7
sun.arch.data.model=32

因此,使用 32 位 JRE 执行应用程序将从<FOLDER>\GROBID_HOME\.\lib\win-32

更新: 使用 32 位 JRE 时出现的错误与 JVM 架构无关。您应该pdf2xml正确安装和配置您的。

于 2012-05-28T11:31:43.050 回答
1

我写在这里只是为了通知您,我们已经为 Windows 64 位集成了 Wapiti 的移植版本。

如果您仍然有兴趣尝试,您可以从master下载/更新 Grobid 开发版本。

pdf2xml 的问题以及使用 Windows 测试时出现的其他小错误已得到解决。批处理和服务模式都工作得很好。对本地运行的不同 Windows 版本进行更密集的测试会很棒。

您可以跟进进度并报告相关问题的最终问题或错误。

于 2016-09-23T10:09:22.020 回答