菜鸟小白的第一页
刚接触myeclipse,就遇到这个问题
1 java.lang.UnsupportedClassVersionError: org/apache/lucene/store/Directory : Unsupported major.minor version 51.0 2 at java.lang.ClassLoader.defineClass1(Native Method) 3 at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631) 4 at java.lang.ClassLoader.defineClass(ClassLoader.java:615) 5 at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141) 6 at java.net.URLClassLoader.defineClass(URLClassLoader.java:283) 7 at java.net.URLClassLoader.access$000(URLClassLoader.java:58) 8 at java.net.URLClassLoader$1.run(URLClassLoader.java:197) 9 at java.security.AccessController.doPrivileged(Native Method) 10 at java.net.URLClassLoader.findClass(URLClassLoader.java:190) 11 at java.lang.ClassLoader.loadClass(ClassLoader.java:306) 12 at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301) 13 at java.lang.ClassLoader.loadClass(ClassLoader.java:247) 14 Exception in thread "main"
把自己的解决记录一下,免得下次再遇到这个问题又要花两天时间来解决
When selecting 1.7 compliance, make sure to have a compatible JRE installed and activated(currently 1.6). Configure the Installed jres' and 'Execution Environments or change the JRE on the Java Build Path
这一段是我改了图一后出现的,当初改的时候根本没有注意到这一段,后来按照提示的去改,终于好了。
后来看到别人的博客说的,jdk版本只能小于或等于jre版本。