Hello:

 

When I tried to compile my first servlet, using the command line,

 

javac -classpath $CATALINA_HOME/common/lib/servlet-api.jar HelloWorld.java

 

I get the following errors, mainly due to the fact that it's unable to find
the package javax.servlet.

 

HelloWorld.java:6: package javax.servlet does not exist

import javax.servlet.*;

^

HelloWorld.java:7: package javax.servlet.http does not exist

import javax.servlet.http.*;

^

HelloWorld.java:9: cannot resolve symbol

symbol  : class HttpServlet

location: class HelloWorld

public class HelloWorld extends HttpServlet {

                                ^

HelloWorld.java:11: cannot resolve symbol

symbol  : class HttpServletRequest

location: class HelloWorld

        public void doGet ( HttpServletRequest request, HttpServletResponse
resp

onse )

                            ^

HelloWorld.java:11: cannot resolve symbol

symbol  : class HttpServletResponse

location: class HelloWorld

        public void doGet ( HttpServletRequest request, HttpServletResponse
resp

onse )

                                                        ^

HelloWorld.java:12: cannot resolve symbol

symbol  : class ServletException

location: class HelloWorld

        throws ServletException, IOException    {

               ^

6 errors

 

Can somebody guide me on how to resolve this issue?

 

Thanks.

 

Venkat

Reply via email to