【问题标题】:Running Grobid on Windows 64 bit在 64 位 Windows 上运行 Grobid
【发布时间】:2012-05-18 23:36:27
【问题描述】:

我正在尝试在 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)

【问题讨论】:

  • 可能:它显示文件夹 \GROBID_HOME\.\lib\win-64 不存在..
  • 与文件夹无关。 libcpp 文件必须在该文件夹中。但是它不可用。
  • 您可以从源代码构建 x64 版本的库或使用 32 位 JRE。
  • 没有适用于 Windows 的库的 x64 位版本(至少我找不到)。它在 64 位 Linux 和 32 位 Windows 上运行。所以即使是 32 位 JRE 也无济于事。
  • 您更新的错误非常不同,您可能想为它开始一个新问题(反垃圾邮件的答案似乎完美地回答了您的第一个问题)。无论如何,你有可能下载了一个unix版本吗?它显然试图运行“lib/pdftoxml”。 Windows 二进制文件最后总是有 .exe 或 .com。检查您提到的文件夹。如果您同时找到“pdftoxml”和“pdftoxml.exe”,请删除没有扩展名的那个,看看它是否能解决您的问题。

标签: windows jvm 32bit-64bit grobid


【解决方案1】:

无法从 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 执行应用程序将从 &lt;FOLDER&gt;\GROBID_HOME\.\lib\win-32 加载本机库

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

【讨论】:

  • 没有适用于 Windows 的库的 x64 位版本(至少我找不到)。它在 64 位 Linux 和 32 位 Windows 上运行。所以即使是 32 位 JRE 也无济于事。
  • 32 位 JVM 会有所帮助。当我需要在 64 位 Windows 中运行具有 32 位本机依赖项的 Java 应用程序时,我检查了自己。试试看。
  • 我试过了。它需要一个 libcrfpp 文件才能运行。这仅适用于带有 64 位 JVM 的 64 位 Linux 和带有 32 位 JVM 的 32 位 Windows。
  • 您能否在使用 32 位 JVM 启动应用程序时发布错误消息?
  • 它在内部尝试运行一个无法运行的 pdftoxml 二进制文件。添加问题中的错误。
【解决方案2】:

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

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

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

您可以在relative issue 跟进进度并报告最终的问题或错误。

【讨论】:

    猜你喜欢
    • 2011-04-03
    • 1970-01-01
    • 1970-01-01
    • 2014-01-10
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多