File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes package javax.servlet does not exist!!! Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "package javax.servlet does not exist!!!" Watch "package javax.servlet does not exist!!!" New topic

package javax.servlet does not exist!!!

divya sharma
Ranch Hand

Joined: Jan 25, 2007
Posts: 87
I am running servlet on textpad while compling it shows me an error that "package javax.servlet does not exist".
Please help me to find the solution of this problem.


Stan James
(instanceof Sidekick)
Ranch Hand

Joined: Jan 29, 2003
Posts: 8791
The servlet stuff is not in the base JDK. If you haven't already, you'll need to download the J2EE jars and get them into your classpath. Here's the
1.4 SDK and it has a link to the Java 5 version.

A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
Jaime M. Tovar
Ranch Hand

Joined: Mar 28, 2005
Posts: 133
If you already have a server running, like tomcat, it already has the j2ee jars, just add them to the -cp option when you javac.

She will remember your heart when men are fairy tales in books written by rabbits.<br /> As long as there is duct tape... there is also hope.
divya sharma
Ranch Hand

Joined: Jan 25, 2007
Posts: 87
Please explain me the process of -cp
Abdulla Mamuwala
Ranch Hand

Joined: Jan 09, 2004
Posts: 225
-cp tells the java compiler (javac) utility to include the j2ee jars in its classpath. I guess the -cp command is unix command.


javac -cp <bye.jar> Hello

compile with bye.jar in the classpath. chill
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 15081

Originally posted by divya sharma:
Please explain me the process of -cp

It is explained in the documentation. Also have a look at this: Setting the class path.

Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 8 API documentation
I agree. Here's the link:
subject: package javax.servlet does not exist!!!
It's not a secret anymore!