java.lang.UnsupportedClassVersionError
java.lang.UnsupportedClassVersionError: org/apache/lucene/index/IndexableField : Unsupported major.minor version 52.0
at java.lang.ClassLoader.defineClass1(Native Method)
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$100(Unknown Source)
at java.net.URLClassLoader$1.run(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 java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Unknown Source)
at java.lang.Class.getMethod0(Unknown Source)
--------------------------------------------------------------------
版本不一致导致的;
1,检查 java Build path --> 的libriary 和 java compiler 的版本是否一致;
2,也可以查看编译后的.class文件 ,还是能看出点端倪的;
3,都没解决的话,就得考虑是不是Lucence的版本过高,和jdk 不匹配;(应该在应用Lucence之前查看)
查看 Lucence下的这个文件,
恭喜你,答对了,jdk要在1.8以上,是不是傻眼了