一、发现问题:启动 tomcat 控制台报该错误。

 
二、原因:tomcat 的 jdk 版本和编译.class的 jdk 版本不一致。
 
三、解决办法:
 
步骤一:
查看 MyEclipse 的 jdk 版本和位置:Window—>Preferences—>Java—>Installed JRES。设置如下图所示:
 
 
 
步骤二:
查看 MyEclipse 的 compiler版本:Window—>Preferences—>Java—>Compiler,
设置成6.0(或者7.0),如下图所示:
 
 
 
 
步骤三:查看某个具体项目的compiler版本:
 
具体项目 properties—>Java—>Compiler;
 
MyEclipse的compiler版本相当于统领全局,具体项目可以设置不同的Compiler版本
 
 
步骤四:查看 tomcat 的 jdk 版本(重要):
 
Window—>Preferences—>MyEclipse—>Servers—>Tomcat—>Tomcat6.0—>jdk
 
一定要保持和那个出问题的项目使用同样版本和位置的jdk。如下图所示:
 
 
然后重启项目就OK了!
 
 
 4、SVN down新项目报JDK编译版本不同错解决方案:
 
 
 
 

Tomcat启动web项目报Bad version number in .class file (unable to load class ...)错误的解决方法的更多相关文章

  1. java.lang.UnsupportedClassVersionError: Bad version number in .class file (unable to load class org.

    1.错误描述 严重: Exception starting filter struts2 java.lang.UnsupportedClassVersionError: Bad version num ...

  2. tomcat启动后报错Bad version number in .class file (unable to load class oracle.jdbc.OracleDriver)

    对于tomcat启动后报错: 错误原因:tomcat使用的jdk和eclipce的编译用的jdk版本不同. 解决办法: 1.首先确定tomcat的jdk版本: 2.点开tomcat查看jdk版本. 使 ...

  3. 启动Tomcat出现“Bad version number in .class file (unable to load class XXX)”解决

    转载自:http://blog.csdn.net/justdb/article/details/8067887 主要是jdk版本的不搭配 保证tomcat 的jdk版本 项目的jdk版本 还有就是编译 ...

  4. 启动tomcat后struts框架报异常严重: Exception starting filter struts2 Unable to load configuration.

    启动tomcat后struts框架报异常严重: Exception starting filter struts2 Unable to load configuration. 出现此异常是因为,str ...

  5. navicat连接oracle数据库报ORA-28547: connection to server failed, probable Oracle Net admin error错误的解决方法

    原文:navicat连接oracle数据库报ORA-28547: connection to server failed, probable Oracle Net admin error错误的解决方法 ...

  6. Tomcat 开发web项目报Illegal access: this web application instance has been stopped already. Could not load [org.apache.commons.pool.impl.CursorableLinkedList$Cursor]. 错误

    开发Java web项目,在tomcat运行后报如下错误: Illegal access: this web application instance has been stopped already ...

  7. 启动tomcat后struts框架报异常严重: Exception starting filter struts2 Unable to load configuration. - Class: java.net.PlainSocketImpl

    今天刚好宿舍断网,打开电脑,打开ide工具,启动tomcat后,访问web项目工程,页面显示404,查看控制台,运行报错信息如下: 严重: Exception starting filter stru ...

  8. ***XAMPP:报错 Unable to load dynamic library的解决方法

    A PHP Error was encountered Severity: Core Warning Message: PHP Startup: Unable to load dynamic libr ...

  9. 小型SSM项目出现Failed to load ApplicationContext错误的解决方法(个人向)

    使用单元测试的时候,出现了Failed to load ApplicationContext错误,在添加了一个新的Mapper.xml文件才出现的,在保证其他配置文件没有出错的情况下,检查mapper ...

随机推荐

  1. mybatis interceptor 处理查询参数及查询结果

    拦截器:拦截update,query方法,处理查询参数及返回结果. /** * Created by windwant on 2017/1/12. */ @Intercepts({ @Signatur ...

  2. Python全栈 项目(HTTPServer、PiP使用)

    pip是Python官方推荐的包管理工具   属于python的一部分            pip的使用    pip的安装             sudo apt-get install pyt ...

  3. 原生js常用方法

    原生JavaScript设置cookie值 function setCookie(name, value, Hours) { var d = new Date(); var offset = 8; v ...

  4. 凸包算法(Graham扫描法)详解

    先说下基础知识,不然不好理解后面的东西 两向量的X乘p1(x1,y1),p2(x2,y2) p1Xp2如果小于零则说明  p1在p2的逆时针方向 如果大于零则说明 p1在p2的顺时针方向 struct ...

  5. Android开发-API指南-<permission>

    <permission> 英文原文:http://developer.android.com/guide/topics/manifest/permission-element.html 采 ...

  6. 【zabbix 监控】第一章 zabbix的安装配置

    安装前准备 一.下载网络yum源: http://mirrors.163.com/.help/centos.html https://opsx.alibaba.com/mirror 1.首先备份/et ...

  7. 使用open live writee写的博客

    1. 安装包 下载链接:open live writer 2. 安装及使用教程 学习教程(转载他人) 3. 插入个图片 4. 写段代码 写不了,插件用不了 5. 插件使用: 参考文章:(http:// ...

  8. selenium实现文件上传方法汇总(AutoIt、win32GUI、sengkeys)---基于python

    在使用selenium进行UI自动化测试时,经常会遇到一个关于本地文件上传的问题,解决此问题一般分两种情况: 1. 元素标签为input 2.非input型上传 下面我们分别对着两种情况进行实例分析 ...

  9. 使用HTML5制作loading图

    昨天发了一篇使用HTML5 canvas写的时钟的文章,今天发一篇关于使用HTML5制作loading图的文章. <!DOCTYPE html> <html> <head ...

  10. 由作业题引发对C++引用的一些思考

    首先分析一段代码: #include <bits/c++config.h> #include <ostream> #include <iostream> #incl ...