File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Tomcat and the fly likes Error:Invalid class file format for HttpServlet class in servlet.jar Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Error:Invalid class file format for HttpServlet class in servlet.jar " Watch "Error:Invalid class file format for HttpServlet class in servlet.jar " New topic
Author

Error:Invalid class file format for HttpServlet class in servlet.jar

Karthik D
Greenhorn

Joined: Sep 21, 2002
Posts: 4
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.

Thanks & Regards,
Karthik
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Error:Invalid class file format for HttpServlet class in servlet.jar
 
Similar Threads
a big problem when I start learning servlet
Tomcat installation problem
Help!! Error in Tomcat
Error running servlet using tomcat.. help please
compiling a servlet