Big Moose Saloon
 Search | Java FAQ | Recent Topics Register / Login

# 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.

Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 58878

59

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.

Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 58878

59

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

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,

i am working on windows.
I am new to this..
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617