MyEclipse配置tomcat报错 - java.lang.UnsupportedClassVersionError: org/apache/lucene/store/Directory : Unsupported major.minor version 51.0

1 开发Servlet程序时,MyEclipse配置好tomcat与JDK之后,启动时控制台报下列错误:

  

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"

  使用环境:MyEclipse 10.7 + tomcat 8.0.37 + MyEclipse自带的JDK1.6.0_13

  经查询得到的结果是tomcat 8.0配置的JDK与MyEclipse自带的不兼容

  2 重新配置MyEclipse项目的Build Path与tomat的JDK选项,使用自己安装的JDK 1.8.0_101

  还是报错,这次是测试的Servlet直接报错,编译都通不过。

  The type java.io.ObjectInputStream cannot be resolved. It is indirectly referenced from required .class files

  

  经查询此错误应该是JDK版本太高,与MyEclipse步兼容引起的。

  3 解决方法

  重新安装1.7版本的JDK,MyEclipse Servlet项目与tomcat都配置成1.7的JDK,就没问题了。

  4 注意事项

注意MyEclipse,tomcat,JDK版本,差距不能太大。例如MyEclipse10.7自带的JDK版本是1.6,默认支持的tomcat是7.0,所以tomcat最好用7.0(最多只能用8.0),JDK最好用1.6(最多只能用1.7).

时间: 2024-10-27 10:37:46

MyEclipse配置tomcat报错 - java.lang.UnsupportedClassVersionError: org/apache/lucene/store/Directory : Unsupported major.minor version 51.0的相关文章

【原创】Exception in thread "main" java.lang.UnsupportedClassVersionError: org/apache/maven/cli/MavenCli : Unsupported major.minor version 51.0

有多个情况造成这种异常,以下列举 1.JDK 和 MAVEN 版本不兼容 从apache 官网下载maven bin 版本,我下的是apache-maven-3.3.3-bin.zip. 下载下来的安装包解压到你的工作目录下.如:E:\开发\apache-maven-3.3.3,配置环境变量,MAVEN_HOME,再把%MAVEN_HOME%\bin配置到 path中. 安装java jdk,配置JAVA_HOME.打开cmd ,输入mvn -r,如果会报错.java.lang.Unsuppor

Exception in thread "main" java.lang.UnsupportedClassVersionError: org/apache/maven/cli/MavenCli : Unsupported major.minor version 51.0

me 的 maven 项目, 右键 update dependencies , 出现 错误 Exception in thread "main" java.lang.UnsupportedClassVersionError: org/apache/maven/cli/MavenCli : Unsupported major.minor version 51.0 at java.lang.ClassLoader.defineClass1(Native Method) at java.la

java.lang.UnsupportedClassVersionError: com/android/build/gradle/AppPlugin : Unsupported major.minor version 52.0解决办法

androidstudio编译程序时出现java.lang.UnsupportedClassVersionError: com/android/build/gradle/AppPlugin : Unsupported major.minor version 52.0.Unsupported major.minor version 52.这个错误是由于(jdk)高版本的java project使用了低版本的来运行.使用命令(java -version 和 javac -version)查看java

java.lang.UnsupportedClassVersionError: xxx/xxxClass : Unsupported major.minor version 51.0

完全参考自 http://www.cnblogs.com/xing901022/p/4172410.html 这种错误的全部报错信息: 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.la

java.lang.UnsupportedClassVersionError: com/mysql/cj/jdbc/Driver : Unsupported major.minor version 5

原因: com/mysql/cj/jdbc/Driver是6.0版本的驱动,兼容JDK8环境,不兼容JDK7环境,在基于jdk7的tomcat中编译运行会出错,在基于jdk8的tomcat中编译运行则不会出错. 解决方案: 1.jdk7+老版5.0驱动com/mysql/jdbc/Driver 2.jdk8+新版6.0驱动com/mysql/cj/jdbc/Driver 原文地址:https://www.cnblogs.com/GH0522/p/9328416.html

运行Tomcat闪退问题,报的错误:Unsupported major.minor version 51.0

在MyEclipse中运行tomcat,tomcat闪退并且报以下错误. java.lang.UnsupportedClassVersionError: org/apache/catalina/startup/Bootstrap : Unsupported major.minor version 51.0 at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassL

Tomcat - java.lang.UnsupportedClassVersionError:Unsupported major.minor version 51.0 (unable to load class com.microsoft.sqlserver.jdbc.SQLS

今天使用Tomcat连接sql Server 2008 enterprise的时候,报错: HTTP Status 500 - Servlet execution threw an exception type Exception report message Servlet execution threw an exception description The server encountered an internal error that prevented it from fulfil

HIVE 1.1.0 启动时报错: Unsupported major.minor version 51.0

JDK 1.6 + HIVE 1.1.0 启动时抛异常: [email protected]:~# hive Logging initialized using configuration in jar:file:/hive/apache-hive-1.1.0-bin/lib/hive-common-1.1.0.jar!/hive-log4j.propertiesSLF4J: Class path contains multiple SLF4J bindings.SLF4J: Found bin

tomcat启动报错:Unsupported major.minor version 51.0

myeclipse中添加项目后,发现项目启动时报错:Unsupported major.minor version 51.0 因为tomcat使用的jdk版本不支持你项目的jdk版本,需要你在myeclipse中配置几个版本: 配置myeclipse中的jre 配置java compiler level 配置项目的compilor level 配置tomcat的jdk preferences->myeclipse->server->tomcat->tomcat7.0->jdk