If other applications (using other packages) compile correctly, then your 
classpath is correct and the problem then is that you don't have installed 
the servlet jar, or it is in the wrong place, which is 

$JAVA_HOME/jre/lib/ext/

The file I have is: servlet-2_3-fcs-classfiles.jar. I guess there could be 
others, depending on your JDK version but the important thing is that this 
jar is not bundled with the JDK.

Gerardo

On Thu, 30 Sep 2004, Venkat & Radha Venkataramanan wrote:

> 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
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to