You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Avinash Sridhar <sm...@rediffmail.com> on 2004/02/02 02:54:58 UTC

Error compiling servlet file,help

Hi,
  Thanks for the suggestion,I did as you told and echo %CLASSPATH% going into the directory,but still the errors as below.Dont know what has to be done.

Hoping to hear from you at the earliest.

Thanks
AS

On Mon, 02 Feb 2004 Marcel Stör wrote :
>Avinash Sridhar <ma...@rediffmail.com> wrote:
> > hi all,
> >     I am having trouble in compiling the HelloServlet.java file,When
> > I type in javac HelloServlet.java file,I get the following errors
> >
> > /**************Errors while compiling**********************/
> >
> > HelloServlet.java:2: package javax.servlet does not exist
> > import javax.servlet.*;
> > ^
> > HelloServlet.java:3: package javax.servlet.http does not exi
> > import javax.servlet.http.*;
> > ^
> > HelloServlet.java:13: cannot resolve symbol
> > symbol  : class HttpServlet
> > location: class HelloServlet
> > public class HelloServlet extends HttpServlet {
> >                                   ^
> > HelloServlet.java:14: cannot resolve symbol
> > symbol  : class HttpServletRequest
> > location: class HelloServlet
> >   public void doGet(HttpServletRequest request,
> >                     ^
> > HelloServlet.java:15: cannot resolve symbol
> > symbol  : class HttpServletResponse
> > location: class HelloServlet
> >                     HttpServletResponse response)
> >                     ^
> > HelloServlet.java:16: cannot resolve symbol
> > symbol  : class ServletException
> > location: class HelloServlet
> >       throws ServletException, IOException {
> >              ^
> > 6 errors
> >
> > /**************Errors while compiling**********************/
> >
> >
> > I have written a batch file tomcat..bat like this
> >
> > /********** tomcat.bat *************/
> >
> > set classpath=;E/tomcat/tomcat-5/common/lib/servlet-api.jar
> > set classpath=;E/tomcat/tomcat-5/common/lib/jsp-api.jar
> >
> > /********** tomcat.bat *************/

Re: Error compiling servlet file,help

Posted by Philipp Taprogge <Ph...@gmx.net>.
Hi!

Avinash Sridhar wrote:
> Thanks for the suggestion,I did as you told and echo %CLASSPATH% going into the directory,
> but still the errors as below.

And the result was... what?

The compiler errors can be interpreted in only one way: the 
servlet-api is _not_ in your classlath. Hence there can be only one 
cause of the problem: you are not adding them correctly.
Thsi is clearly a shell issue.

>>>/********** tomcat.bat *************/
>>>
>>>set classpath=;E/tomcat/tomcat-5/common/lib/servlet-api.jar
>>>set classpath=;E/tomcat/tomcat-5/common/lib/jsp-api.jar
>>>
>>>/********** tomcat.bat *************/

I see three issues here: for one I don't know what that leading ; is 
about. If it's not a problem, it is definitively not necessary. 
Secondly, I am not sure if you can use forward slashes in the 
classpath on Windose machines. And either way, you are missing a : as 
in E: at the beginning.

HTH

		Phil


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org