This week's book giveaway is in the Performance forum.
We're giving away four copies of The Java Performance Companion and have Charlie Hunt, Monica Beckwith, Poonam Parhar, & Bengt Rutisson on-line!
See this thread for details.
Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

package javax.servlet does not exist!!!

 
divya sharma
Ranch Hand
Posts: 87
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
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.

thanks
divya
 
Stan James
(instanceof Sidekick)
Ranch Hand
Posts: 8791
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Jaime M. Tovar
Ranch Hand
Posts: 133
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
divya sharma
Ranch Hand
Posts: 87
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please explain me the process of -cp
 
Abdulla Mamuwala
Ranch Hand
Posts: 225
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
-cp tells the java compiler (javac) utility to include the j2ee jars in its classpath. I guess the -cp command is unix command.

example

javac -cp <bye.jar> Hello

compile Hello.java with bye.jar in the classpath. chill
 
Jesper de Jong
Java Cowboy
Saloon Keeper
Pie
Posts: 15369
40
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic