can't compile servlet, javac can't find servlet classes

when i try to compile a servlet file
with javac it can not find servlet classes for ex httpservlet
I already put classpath to tools.jar

and what should I do when this is done.
when I plase this class in my webdirectory (subdir servlets)
how to start it

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

are you sure you have the servlet package?


javap javax.servlet.http.HttpServlet

if its on your classpath correctlythen you should get a list of its methods, if not it will return an error.

if it sin;t there, go to

and download the servlet dev kit.
Isnt the servlet jar file jsdk.jar??

If you are using the classpath variable make sure you set the full path and the jar file explicitly.
For example:
set classpath=%classpath%;c:\jsdk20\lib\jsdk.jar;

If you have JDK1.2 (Java 2) you can place all extensions in the extension directory.  This is located at:
c:\jdk12\jre\lib\ext\   (if jdk12 is your install directory)

I dont have a classpath set at all.
Every extension I have -- JMF,JSDK,even third party classes have their jar files located in this directory.  That way I can compile everything regardless of classpath setting.  This directory is actually checked FIRST before classpath.
See the Java Tutorial for more info:



Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
d97adkaAuthor Commented:
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Java EE

From novice to tech pro — start learning today.