我尝试通过Eclipse neon中的OWL API生成本体。它没有任何错误但无法执行。
public class TestOntology {
public static void main(String[] args) {
OWLOntologyManager man = OWLManager.createOWLOntologyManager();
IRI ontologyIRI = IRI.create("http://130.88.198.11/co-ode-files/ontologies/pizza.owl");
try {
OWLOntology ontology = man.loadOntology(ontologyIRI);
System.out.println(ontology.getLogicalAxiomCount());
} catch (OWLOntologyCreationException e) {
e.printStackTrace();
}
*my error*
java.lang.UnsupportedClassVersionError: org/semanticweb/owlapi/model/OWLOntologyCreationException : Unsupported major.minor version 51.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClassCond(Unknown Source)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$000(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at sun.misc.Launcher$ExtClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
Exception in thread "main"
答案 0 :(得分:0)
类版本51是Java 7.您是否在Java 6上运行OWLAPI 4?
OWLAPI 4的最低要求是Java 7。