File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes Which version of Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Head First Android this week in the Android forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Which version of "servlet-api.jar" should I download and from where ?" Watch "Which version of "servlet-api.jar" should I download and from where ?" New topic

Which version of "servlet-api.jar" should I download and from where ?

Rohit Dalmia

Joined: May 20, 2008
Posts: 1
I am compiling a .java file using javac thru command prompt

Compiler throws this error,

bad class file: XXXX\servlet-api.jar (javax/servlet/http/HttpServletRequest.class)

class file has wrong version 49.0, should be 48.0

import javax.servlet.http.HttpServletRequest;

Please tell which version of this JAR should I download AND from where ?

Please reply asap. Thanks in Advance !
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14916

Welcome to JavaRanch.

The error message that you get means that you are trying to use a JAR file which is for Java 5 and newer on JDK 1.4.

Where did you get that servlet-api.jar? Are you using Tomcat 6.0? Note that Tomcat 6.0 requires Java 5 or newer, it will not work on Java 1.4.

Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 8 API documentation
Niket Shah

Joined: Nov 14, 2006
Posts: 1
HI Jesper,

I am facing the same problem. I am using the JDK version 1.6.0_10. and tomcat 6.0.16. Do you think we need to change our Servlet-api.jar file with the older version..

~ Niket Shah
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63053

No. Read Jesper's response.

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
I agree. Here's the link:
subject: Which version of "servlet-api.jar" should I download and from where ?
It's not a secret anymore!