Meaningless Drivel is fun!*
The moose likes Servlets and the fly likes Compiling the servlet, please help Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Servlets
Bookmark "Compiling the servlet, please help " Watch "Compiling the servlet, please help " New topic
Author

Compiling the servlet, please help

claudio manuel
Greenhorn

Joined: Nov 26, 2004
Posts: 1
I have downloaded C:\j2sdkee1.3.1 and C:\j2sdk1.4.2_06 and C:\Program Files\Apache Tomcat 4.0.

All the simple java programs works fine. But with servlets I have the following errors:
It gives me a compiler error as follows:

C:\JavaAssg\SimpleServlet.java:1: cannot resolve symbol
symbol : class HttpServlet
location: class SimpleServlet
public class SimpleServlet extends HttpServlet{

what else should be in the path?
it seems to me that it is unable to find the class HttpServlet?
do I have to create \webpages\web-inf subfolders?

Can somebody please help me??
vishwa venkat
Ranch Hand

Joined: Nov 22, 2003
Posts: 185
set classpath to servlet class files..

If ur using tomcat4.x
set classpath=%TOMCAT_HOME%\common\lib\servlet.jar;.;

using tomcat5.x
set classpath=%TOMCAT_HOME%\common\lib\servlet-api.jar;.;
Al Petersen
Greenhorn

Joined: Nov 27, 2004
Posts: 9
And don't forget to import javax.servlet.http.HttpServlet in your class!
 
GeeCON Prague 2014
 
subject: Compiling the servlet, please help