Error:Invalid class file format for HttpServlet class in servlet.jar
Karthik D
Greenhorn
Joined: Sep 21, 2002
Posts: 4
posted
0
Hello All, I was trying to compile a sample servlet program under the following environment Windows NT 4 SP 5 Apache Tomcat 4.1.12 Sun JDK 1.4.0 I am getting the following error : E:\javaprog>javac ServletTemplate.java error: Invalid class file format in E:\Tomcat 4.1\common\lib\servlet.jar(javax/servlet/http/HttpServlet.class). wrong version: 46, expected 45 ServletTemplate.java:5: Superclass javax.servlet.http.HttpServlet of class ServletTemplate not found. public class ServletTemplate extends HttpServlet{ ^ 2 errors I checked the CLASSPATH and JAVA_HOME variable. The JAVA_HOME is set to the path where jdk 1.4 is installed.The CLASSPATH includes the path to servlet.jar found under TOMCAT_HOME\common\lib. Has someone else faced a similar problem?I have seen some posts w.r.t to rt.jar but I think here the JVM is not the problem.