`
softdn
  • 浏览: 40566 次
  • 性别: Icon_minigender_1
  • 来自: 上海
社区版块
存档分类
最新评论

Bad version number in .class file的问题

阅读更多

1:问题出现背景:

    升级jdk1.6,和tomcat6.0,在myeclipse7.0里重新编译工程,启动tomcat6.0,读到struts.xml第一个action设置时出现:Bad version number in .class file的问题

    java.lang.UnsupportedClassVersionError: Bad version number in .class file
    ... ...

 

2:分析

   出现这个问题肯定是版本不对。jdk版本,struts版本等

 

3:解决办法 

   3.1 确认编译环境的jdk版本为1.6

         设置eclipse的编译环境window---preferences---java---Installed JREs进行JRE的设置。

         设置eclipse的编译环境window---preferences---java---Compiler,选择1.6.

   3.2 确认运行的版本和tomcat结合的版本是否跟编译jdk版本一致

         windows命令行,键入:java -version 查看版本为1.6.0_13

         eclipse或myeclipse的tomcat设置,选择正确的版本(tomcat6.0+jdk1.6),

         tomcat6.X展开,可以查看到关联的jdk,选择,正确的jdk版本。

         (这个jdk是在3.1JREs进行设置过的,默认系统会列出不同版本,只要选择你3.1里一致的编译jdk版本即可)

         tomcat6展开后未指定jdk,在eclipse/myeclipse里启动tomcat时,会出现Nullpoint异常。

   3.3 project里导入的jdk版本也要一致,Project---Properties---Java Build Path 更改对应的jdk版本。

 

ok 至此,启动tomcat,跑起来了,升级所产生的环境问题,解决!

分享到:
评论

相关推荐

    java.lang.UnsupportedClassVersionError Bad version number in .class file异常的解决办法

    在MyEclipse中运行一个小应用程序或者在编辑一些程序时,出现java.lang.UnsupportedClassVersionError Bad version number in .class file异常,的解决办法!

    Flash Builder 4 正式版中 解决使用LCDS ES2 Data/Services 出现 Bad version number in .class file 问题

    这两天遇到了一个问题,原来使用的是FB 4 Bata 2中没有遇到的问题,在FB 4中遇到了,就是在使用Data/Services...Bad version number in .class file 问题,现在知道怎样一回事了,希望能帮更多人解决这方面的困扰。

    Bad version number in .class file 错误

    NULL 博文链接:https://happypigs.iteye.com/blog/675096

    tomcat:bad version number in class file的解决方法

    tomcat:bad version number in class file的解决方法

    AXMLPrinter2、baksmali、smali、dex2jar

    number in .class file at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(Unknown Source) at java.security.SecureClassLoader.defineClass(Unknown Source) at ...

    scraper-one:第一个仅使用 Java 的刮刀项目

    我花了一整天来解决这个问题:( jdk 1.7.0_51 上的 UTC+3 不正确使用 bash 运行 scraper-1.0-SNAPSHOT.jar 时遇到 java.lang.UnsupportedClassVersionError: Bad version number in .class file。 在 Windows 上使用...

    JBOSS5+JDK6+myeclipse8.6搭建EJB3环境-已成功

    1.安装JDK1.6并配置环境变量 2.下载JBOSS,将下载的安装包直接解压到安装...注意:当我安装JDK1.5+JBOSSjboss-5.1.0.GA组合时,报版本冲突错误(Bad version number in .class file错误),我换成JDK1.6就不报错误了。

    Java 免费给手机发飞信

    一 java.lang.UnsupportedClassVersionError: Bad version number in .class file 必须使用jdk 1.6 二 Exception in thread "main" java.lang.RuntimeException: Your license has expired. Please registe ...,...

    servlet2.4doc

    getAttribute(String) - Method in class javax.servlet.ServletRequestWrapper The default behavior of this method is to call getAttribute(String name) on the wrapped request object. getAttribute(String...

    BobBuilder_app

    In this version I have done away with the b+tree and hash index in favor of my own MGIndex structure which for all intents and purposes is superior and the performance numbers speak for themselves....

    php.ini-development

    development version only in development environments as errors shown to ; application users can inadvertently leak otherwise secure information. ; This is php.ini-development INI file. ;;;;;;;;;;;;...

    Delphi7.1 Update

    visit the Borland Registered User web site to obtain a localized readme file that may contain important late- breaking information not included in this readme file.IMPORTANT: Delphi must be closed ...

    Sakemail

    :)26/3/981.6.1- Added a FUNCFileName private variable to manage the complete path of the attached file. I receive problems reports with this, it work now ?.- Reduced the line sleep to 30 (tell me if ...

    微软内部资料-SQL性能优化2

    Those pages may however have to be faulted in from a page file or memory mapped file. Backing Store Backing store is the physical representation of a memory address. Page Fault (Soft/Hard) A ...

    Bochs - The cross platform IA-32 (x86) emulator

    class, optional commit support on Bochs exit, save/restore file attributes, 1.44 MB floppy support, set file modification date/time - converted the complete hdimage stuff to the new 'hdimage' ...

    微软内部资料-SQL性能优化3

    If the class is not confident in their understanding, review appendix A04_Locking and its accompanying PowerPoint® file. Transactions in SQL Server provide the ACID properties: Atomicity A ...

    一个跨平台的CString源码

    // 2001-APR-27 - StreamLoad was calculating the number of BYTES in one // case, not characters. Thanks to Pablo Presedo for this. // // 2001-FEB-23 - Replace() had a bug which caused infinite ...

    xplite_trial

    We currently distribute both an XPlite and 2000lite program as there are some advanced features coming in a future version that require we split them. XPlite/2000lite Professional is entirely self-...

    Rad Studio Delphi C++builder XE 10.4 Patch2

    This patch addresses a number of issues in RAD Studio 10.4, pertaining to Delphi Compiler, the RAD Studio IDE in general and the new LSP-based Code Insight in particular, plus C++ Builder Android ...

Global site tag (gtag.js) - Google Analytics