简体   繁体   中英

Running Grobid on Windows 64 bit

I am trying to execute GROBID on a 64-bit Windows.

There is no x64 bit version of the library for Windows (Atleast I could not find). It runs on 64 bit Linux with 64 bit JRE and on 32 bit Windows with 32 bit JRE. So the version of JRE is not the problem.

I understand I need to include the 64-bit Windows - libcrfpp file. However I cannot find it. Can you please let me know where can I find it or help me execute it?

However I get an errors as follows -

Error when trying to run it using a 64 bit JVM on Windows 64 -

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

UPDATE Error when trying to run it using a 32 bit JVM on Windows 64 -

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)

It is not possible to load a 32-bit native library from a 64-bit JVM.

But you can install a 32-bit JVM on your 64-bit Windows and run a Java application which uses a 32-bit native library.

UPDATE:

This is a excerpt of the application launcher

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);
}

The application is checking property sun.arch.data.model to get the native library folder. If you use a 32-bit JVM in a 64-bit Windows, you get

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

So executing the application with a 32-bit JRE would load the native libraries from <FOLDER>\\GROBID_HOME\\.\\lib\\win-32

UPDATE: The error you get when using 32-bit JRE has nothing to do with JVM architecture. You should install and configure your pdf2xml correctly.

I'm writing here just to inform you that we've integrated the ported version of Wapiti for Windows 64bit.

If you are still interested to try, you can just download/update the Grobid development version from master .

The issues with pdf2xml have been solved as well as other minor bugs that emerged when testing with Windows. Batch and service mode are both working just fine. Would be great to have more intensive testing on different Windows versions running natively.

You can follow up the progress and report eventual problems or bugs at the relative issue .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM