I have aged 6 years since I last coded in Java. So I wasn't quite sure what to make of this Stanford Parser error in the NLP summer school lab. For a while I was quite sure that I didn't set the Java CLASSPATH properly and thus the parser is spewing blood and gore all over me. But after a hour of mucking around I realised that it wasn't so. The real problem seems to that the parser doesn't seem to run well with gij .
$ gij --version
gij (GNU libgcj) version 3.4.6 20060404 (Red Hat 3.4.6-3)
$ ./lexparser.csh
Warning: -server not understood. Ignoring.
Warning: -mx150m not understood. Ignoring.
Exception in thread "main" java.lang.ClassFormatError: edu.stanford.nlp.parser.lexparser.LexicalizedParser (erroneous method access flags)
at _Jv_ClassReader.throw_class_format_error(byte) (/usr/lib/libgcj.so.5.0.0)
at _Jv_ClassReader.handleMethod(int, int, int, int) (/usr/lib/libgcj.so.5.0.0)
at _Jv_ClassReader.read_methods() (/usr/lib/libgcj.so.5.0.0)
at _Jv_ClassReader.parse() (/usr/lib/libgcj.so.5.0.0)
at _Jv_DefineClass(java.lang.Class, byte[], int, int) (/usr/lib/libgcj.so.5.0.0)
at java.lang.VMClassLoader.defineClass(java.lang.ClassLoader, java.lang.String, byte[], int, int, java.security.ProtectionDomain) (/usr/lib/libgcj.so.5.0.0)
at java.lang.ClassLoader.defineClass(java.lang.String, byte[], int, int, java.security.ProtectionDomain) (/usr/lib/libgcj.so.5.0.0)
at java.security.SecureClassLoader.defineClass(java.lang.String, byte[], int, int, java.security.CodeSource) (/usr/lib/libgcj.so.5.0.0)
at java.net.URLClassLoader.findClass(java.lang.String) (/usr/lib/libgcj.so.5.0.0)
at gnu.gcj.runtime.VMClassLoader.findClass(java.lang.String) (/usr/lib/libgcj.so.5.0.0)
at java.lang.ClassLoader.loadClass(java.lang.String, boolean) (/usr/lib/libgcj.so.5.0.0)
at _Jv_FindClass(_Jv_Utf8Const, java.lang.ClassLoader) (/usr/lib/libgcj.so.5.0.0)
at java.lang.Class.forName(java.lang.String, boolean, java.lang.ClassLoader) (/usr/lib/libgcj.so.5.0.0)
at java.lang.Class.forName(java.lang.String) (/usr/lib/libgcj.so.5.0.0)
at gnu.gcj.runtime.FirstThread.run() (/usr/lib/libgcj.so.5.0.0)
at _Jv_ThreadRun(java.lang.Thread) (/usr/lib/libgcj.so.5.0.0)
at _Jv_RunMain(java.lang.Class, byte const, int, byte const, boolean) (/usr/lib/libgcj.so.5.0.0)
at __gcj_personality_v0 (/home/iasnlp2008/Desktop/stanford-parser-2007-08-19/java.version=1.4.2)
at __libc_start_main (/lib/tls/libc-2.3.4.so)
at _Jv_RegisterClasses (/home/iasnlp2008/Desktop/stanford-parser-2007-08-19/java.version=1.4.2)
To test my hunch I changed machines and tried with other version of Java (viz 1.5.x) and it worked without a breaking a sweat. Except for the minor problems like this mistake in script the exparser-gui.csh on line $scriptdir/stanford-parser.jar: everything seems to be alright so far.
$ java -version
java version "1.5.0_05"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_05-b05)
Java HotSpot(TM) Server VM (build 1.5.0_05-b05, mixed mode)