To *compile* a servlet, you need to have the servlet.jar file (from inside
the $CATALINA_HOME/common/lib directory) on your class path.  Without
this, none of the servlet API classes will be recognized -- which is
exactly the error you got.

After you get over your learning curve, you'll find it *much* easier to
use the Ant build tool to manage compilation class paths for you.  See the
online docs at:

http://jakarta.apache.org/tomcat/tomcat-4.0-doc-exp/appdev/index.html

Craig


On Wed, 5 Sep 2001 [EMAIL PROTECTED] wrote:

> Date: Wed, 5 Sep 2001 20:19:59 EDT
> From: [EMAIL PROTECTED]
> Reply-To: [EMAIL PROTECTED]
> To: [EMAIL PROTECTED]
> Subject: Re: Upcoming Tomcat 4.0 Final Release
>
> Craig,
>
> Something interesting happening over here with Tomcat Beta 7 that might
> interest you, or perhaps you can provide a solution for the problem I am
> experiencing.  After installing Tomcat 4, I built a very simple servlet for
> testing purposes.  This particular servlet compiled and executed without any
> problem.  Several day's later, I wrote a new servlet for jdbc testing. When I
> compiled the java file, it failed.  At the same time while attempting to
> rebuild the original test servlet code under a different file name, the same
> error occurred.  It seems as though I can no longer compile my java files
> successfully.  Below is the servlet code, a copy of my autoexec.bat file, and
> the error I am receiving.  If this is a bug, I hope I have been helpful, and
> if its something I'm doing wrong, I would appreciate some help at resoving
> this.
>
> OS: Windows 98
> autoexec.bat:
> PATH=%PATH%;"C:\Program Files\Mts;C:\jdk1.3.0_02\bin
>
> CLASSPATH=C:\jdk1.3.0_02
>
> set JAVA_HOME=C:\jdk1.3.0_02
>
> set CATALINA_HOME=C:\work\pkgs\tomcat4
>
> Original successfully compiled Servlet:
> For your convenience, I have attached the file.  I hope that user email
> application allows for this.
>
> javac compilation error message's;
> cannot resolve symbol
>
> MyFirstServlet2.java: 10 HttpServletResponse
>
> cannot resolve symbol
>
> MyFirstServlet2.java: 10 ServletException
>
>
> Brian
>

Reply via email to