This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
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 Android Security Essentials Live Lessons 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
Author

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

Rohit Dalmia
Greenhorn

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: 14074
    
  16

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 7 API documentation
Scala Notes - My blog about Scala
Niket Shah
Greenhorn

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
Marshal

Joined: Jan 10, 2002
Posts: 60821
    
  65

No. Read Jesper's response.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Which version of "servlet-api.jar" should I download and from where ?
 
Similar Threads
Problems compiling servlet
Netbeans + Servlets
error in the source file
compiling servlet and tomcat
How many Claspath set for running struts application?