---
title: "JDK不兼容异常（class file has wrong version 49.0, should"
author: "zidane1983"
date: "2009-05-23T19:42:31Z"
tags: ["Apache", "Eclipse", "JDK", "JSP", "Web"]
slug: "jdk-class-file-has-wrong-version-49-0-should"
draft: false
lastmod: "2009-05-23T19:42:31Z"
id: 394295
url: "https://zidane1983.iteye.com/blog/394295"
---

**org.apache.jasper.JasperException: Unable to compile class for JSP**  
**Generated servlet error:**  
**/usr/tomcat5/work/Catalina/www.neasiaexpo.org.cn/\_/org/apache/jsp/sysadmin/event/addmore\_005fproject\_jsp.java:8: cannot access web.OperateExcel**  
**bad class file: /bak/upload/neasiaexpo/WEB-INF/classes/web/OperateExcel.class**  
**class file has wrong version 49.0, should be 48.0**  
**Please remove or make sure it appea**  
\----------------------------------------------------------------  
由于OperateExcel这个类是在JDK1.5的环境下编译的，把他放在JDK1.4环境的服务器下发生以上错误，只要将这个类重新在JDK1.4环境下编译就可以了  
   
Eclipse中JDK不兼容异常（class file has wrong version 49.0, should be 48.0）的解决方法  
在eclipse 里改变项目的属性设置：\[project]-&gt;\[properties]-&gt;\[Java Compiler]-&gt;选中Enable project specific settings,在JDK Compliance-&gt;Compiler compliance level中选1.4（或其它你认为合适的），软件会自动提示需要重新编译，重新编译后运行就ok了。