• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
  • Bear Bibeault
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • salvin francis
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Frits Walraven
  • Jj Roberts
  • Carey Brown
  • Scott Selikoff

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

Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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,
You’ll find me in my office. I’ll probably be drinking. And reading this tiny ad.
the value of filler advertising in 2021
    Bookmark Topic Watch Topic
  • New Topic