I am using stanford-classifier-3.5.1 jar on my system and trying to run the example classifier only. I am getting the following error:
Exception in thread "main" java.lang.UnsupportedClassVersionError: edu/stanford/nlp/classify/ColumnDataClassifier : Unsupported major.minor version 52.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:800)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
at ClassifierDemoStanford.main(ClassifierDemoStanford.java:20)
I have tried with Java version 1.6, 1.7 both. The readme file says This software requires Java 5 (JDK 1.6.0+).
Please help.
Answer
The error message means that the code requires Java 8. I checked out the website and the latest release supports Java 8, since October 2014.
I would estimate that the readme file is out of date.
If you use Java 8 it will run this fine.
If you can't upgrade to Java 8, you might downgrade the version of the classifier jar file to the version before Java 8 was added - version 3.4.1
http://nlp.stanford.edu/software/classifier.shtml
No comments:
Post a Comment