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

servlet compilation

Shuaib Gill
Ranch Hand

Joined: May 29, 2001
Posts: 62
I downloaded JDK 1.3.1 from Sun's website and I would like to write and compile Java servlets. How should I set up the development environment on my local PC so I can compile servlets? Right now I wrote a HelloWorldServlet and it gave me this error:
^ cannot resolve symbol
symbol : class HttpServletRequest
location: class HelloWorldServlet
public void doGet(HttpServletRequest req,
^ cannot resolve symbol
symbol : class HttpServletResponse
location: class HelloWorldServlet
public void doGet(HttpServletRequest req, cannot resolve symbol
symbol : class ServletException
location: class HelloWorldServlet
throws ServletException, IOException
6 errors
I downloaded the Servlet API from Sun also, but I can't understand why this is happening? I also changed my CLASSPATH statement. What am I doing wrong?

William Brogden
Author and all-around good cowpoke

Joined: Mar 22, 2000
Posts: 13037
You will also need a servlet "engine" or container in order to run servlets locally. The recommended one is Tomcat - download from the web site. The Tomcat instructions should explain which jar file goes where.
Jimi Rock
Ranch Hand

Joined: Feb 19, 2001
Posts: 134
Go to the following URL:
hanumanth reddy
Ranch Hand

Joined: Jun 12, 2000
Posts: 118

Install some jws or tomcat servers on your system then set classpath accordinglingly

<a href="" target="_blank" rel="nofollow"></a><br /> 'Add Job To Life'
Kristy McClure

Joined: Jun 19, 2001
Posts: 13
Glad Im not nuts... I just ran into the same problem, and answers to these questions can be so hard to find for people like me who are new to Java.
I"m new here -- thanks to all of you for providing this forum. I've recommended it to some other people I work with, who are also in the learning curve when it comes to Java, JSP, servlets, Tomcat, etc...
[This message has been edited by Kristy McClure (edited June 19, 2001).]

pardon me, but you've obviously mistaken me for someone who gives a damn...
I agree. Here's the link:
subject: servlet compilation
It's not a secret anymore!