This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Servlets and the fly likes package javax.servlet.http does not exist 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 » Java » Servlets
Bookmark "package javax.servlet.http does not exist" Watch "package javax.servlet.http does not exist" New topic
Author

package javax.servlet.http does not exist

Sunny Indian
Greenhorn

Joined: Sep 01, 2010
Posts: 3
Hi friends,

though I have set the classpath for servlet-api.jar
still I am getting "package javax.servlet.http does not exist" error.
Can someone help me.

thnaks in advance
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60774
    
  65

Please reservev bold for emphasis, not an entire post. I have removed it for you. Also, please check your private messages for an important administrative matter. Thanks.

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60774
    
  65

Sunny Indian wrote:though I have set the classpath for servlet-api.jar

You may think so, but apparently this is not the case. Otherwise, you would not be getting the error.
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Yeah, I'd set it righter--how are you setting it?
Sunny Indian
Greenhorn

Joined: Sep 01, 2010
Posts: 3
Hi David,

I used
E:\>set CLASS_PATH=.;%CLASS_PATH%;D:\Softwares\apache-tomcat-5.5.30\common\lib\servlet-api.jar;


right now I can see it as folows
E:\>echo %class_path%
D:\Softwares\apache-tomcat-5.5.30\common\lib\servlet-api.jar;D:\lib\servlet-2.3.jar

please help..
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

It's "CLASSPATH", although in general I don't recommend setting it as an environment variable--it always leads to trouble. Better to set it explicitly in the java/javac command. This can be done inside a batch/shell script if you don't want to type it every time, or you could use Ant.
Sunny Indian
Greenhorn

Joined: Sep 01, 2010
Posts: 3
Hi,

please help me in doing it using java/javac.
i am working on windows.
I am new to this..
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

http://download.oracle.com/javase/6/docs/technotes/tools/windows/javac.html#options

The -cp/-classpath option. Same for the java command.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: package javax.servlet.http does not exist
 
Similar Threads
javax.servlet
Help
javax.Servlet.. Oh where, oh wher can it be?
Unable to import
Problem in Compilation