wood burning stoves 2.0*
The moose likes Servlets and the fly likes Servlet package is not accessible Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Servlet package is not accessible" Watch "Servlet package is not accessible" New topic
Author

Servlet package is not accessible

Rashid Ali
Ranch Hand

Joined: Jan 16, 2001
Posts: 349
When i try to compile my servlet application, it does not compile and through an error that javax.servlet.* ; and javax.servlet.http.*; packages are not accessible to it even though my code is cent percent okay and it should be compiled without any error.
May i know which file i missing in my j2sdk13 causing my servlet liberary unaccessible. I am running J2SDK13 under WIN98 environment.
Please advise.
Thanks in advance.
Rashid Ali
Arun Boraiah
Ranch Hand

Joined: Nov 28, 2001
Posts: 233
All you need to do is either set classpath env variable to jsdk.jar file. or append classpath in the local command window (used to compile your servlet file)to jsdk.jar which is found in the lib folder of your jsdk installation folder.
-arun


Sharing is learning
Rashid Ali
Ranch Hand

Joined: Jan 16, 2001
Posts: 349
Thanks for your prompt reply.
But actually on my computer there's only Tomcat installed not JSDK.
So in that case should i have to set the classpath of javax.servlet directory available with Tomcat installation?
Please revert.
Rashid Ali
Arun Boraiah
Ranch Hand

Joined: Nov 28, 2001
Posts: 233
hi if you have only tomcat installed in your system. Then to compile servlet put servlet.jar in your classpath to compile which is presnet in <tomcat root>\lib folder.
-arun
Rashid Ali
Ranch Hand

Joined: Jan 16, 2001
Posts: 349
Thank you very much Arun, i shall try today night and will revert back to you tomorrow, as i am at work and i have to do this with my home computer.
Thanks again for your help.
Rashid
Rashid Ali
Ranch Hand

Joined: Jan 16, 2001
Posts: 349
Thanks Arun, its perfectly running.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Servlet package is not accessible