2

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)
Wolfgang Fahl
  • 15,016
  • 11
  • 93
  • 186
JHS
  • 7,761
  • 2
  • 29
  • 53
  • probably: it shows Folder \GROBID_HOME\.\lib\win-64 does not exist.. – Murtaza Khursheed Hussain May 28 '12 at 09:45
  • Its not about the folder. libcpp file has to be there in that folder. However it is not available. – JHS May 28 '12 at 09:48
  • You can build x64 version of the library from source or use 32-bit JRE. – pingw33n May 28 '12 at 11:03
  • There is no x64 bit version of the library for Windows (Atleast I could not find). It runs on 64 bit Linux and on 32 bit Windows. So even a 32 bit JRE wont help. – JHS May 28 '12 at 11:08
  • your updated error is very different and you might want to start a new question for it (antispam's answer seems to answer your first q perfectly). anyways, is it possible you downloaded a unix version? it clearly tries to run "lib/pdftoxml". windows binaries always have .exe or .com at the end. check in the folder you mentioned. if you find both, "pdftoxml" and "pdftoxml.exe" delete the one without the extension and see if it fixes your problem. – kritzikratzi May 30 '12 at 16:54

2 Answers2

2

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.

Community
  • 1
  • 1
fglez
  • 8,422
  • 4
  • 47
  • 78
  • There is no x64 bit version of the library for Windows (Atleast I could not find). It runs on 64 bit Linux and on 32 bit Windows. So even a 32 bit JRE wont help. – JHS May 28 '12 at 11:40
  • A 32-bit JVM WILL help. I checked myself when I needed to run a Java application with 32-bit native dependencies in a 64-bit Windows. Try it. – fglez May 28 '12 at 11:42
  • I did try it. It needs a libcrfpp file to run. This is available only for 64 bit Linux with 64 bit JVM and for 32 bit Windows with 32 bit JVM. – JHS May 28 '12 at 11:46
  • Could you post the error message when starting the application with a 32-bit JVM? – fglez May 28 '12 at 11:52
  • Internally it tries to run a pdftoxml binary file which does not run. Added the error in the question. – JHS May 28 '12 at 13:56
  • Have you downloaded and installed pdftoxml for Windows and configured PDF2XML_HOME environment variable? Could you post its value? – fglez May 28 '12 at 14:08
  • I have downloaded it. It comes with the the GROBID code (svn checkout). It is I have not set the environment variable as I did not had to set it while running it on Windows 32 bit or Linux 32 bit. – JHS May 28 '12 at 14:18
  • Download Win32 version from http://sourceforge.net/projects/pdf2xml/files/ and configure PDF2XML_HOME correctly. You should have an `exe` file – fglez May 28 '12 at 14:20
  • let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/11827/discussion-between-juniad-and-antispam) – JHS May 28 '12 at 14:30
1

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.

Luca Foppiano
  • 157
  • 12