• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Rohit Dalmia
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 15207
36
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Niket Shah
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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..
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64622
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No. Read Jesper's response.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic