File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes a bit confused Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "a bit confused" Watch "a bit confused" New topic

a bit confused

jayram joshi

Joined: Aug 05, 2000
Posts: 23
hello frens,
I downloaded tomcat and was trying to run my program
I was getting messages like...
import package not found for servlet and HttpServlet packages.So i used jar and unzipped the jar file ...and now my servlets got compiled ...but it doesnt make sense ...does it to u??
Please throw some light on this...
Bhupinder Dhillon
Ranch Hand

Joined: Oct 12, 2000
Posts: 124
When invoking javac you have to specify the .jar file in classpath argument.
eg: javac -classpath <pathToJarFiel>\servlets.jar filenames
Ranch Hand

Joined: Oct 30, 2000
Posts: 94
The solution u provided is for the case where the classpath is not already set.My classpath is set correctly so i dont think I need to provide it explicitly while invoking java compiler.What puzzled me is the fact that same classpath worked for me when I extrated classes from servlet.jar file .Please...can anyone throw some light on this phenomenon ...why did this happen???

I agree. Here's the link:
subject: a bit confused
It's not a secret anymore!