my dog learned polymorphism
The moose likes Servlets and the fly likes Problem in compilation Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Problem in compilation" Watch "Problem in compilation" New topic

Problem in compilation

deshdeep divakar
Ranch Hand

Joined: Apr 19, 2004
Posts: 91
I have developed a servlet,problem i m facing
are 1. it is not importing the packages.

tell the appropriate method to compile nd run a servelet

"Do not be afraid of going slow, be afraid of standing still"
Saket Barve
Ranch Hand

Joined: Dec 19, 2002
Posts: 229

What is your classpath set to? How exactly are you compiling your servlet?

Sarath Mohan
Ranch Hand

Joined: Mar 17, 2001
Posts: 213
Seems you need to keep servlet-api.jar in your classpath. This will make the class to compile. Now in oreder RUN the servlet you require a servlet container like Tomcat or JRun

Visit for more resources


Sarath Mohan
deshdeep divakar
Ranch Hand

Joined: Apr 19, 2004
Posts: 91
hi this is a problem related to compilation of the servlet program.
classpaths are set as: c:\jdk1.4\lib\dt.jar;
but on compiling the servlet in command prompt by javac compiler the error is the packages of servlet and servlet.http. do not exist.
there is no problem in running applet.
Girish Babu

Joined: Mar 18, 2005
Posts: 6

in your command prompt before doing javac type this and try:

set classpath=%classpath%;c:\jdk1.4\lib\servlet-api.jar;.;

then compile,

still if it is not compiling then let us knw the web-server u r planning to host your servlet on, may be someone can help you,

I agree. Here's the link:
subject: Problem in compilation
It's not a secret anymore!