Andrew,
I tried your suggestion and I am now able to compile my file under both
windows
and linux. Thank you very much for your help, I appreciate it.
Anthony
-----Original Message-----
From: Andrew [mailto:andrew@h...]
Sent: Tuesday, June 18, 2002 9:14 PM
To: Servlets
Subject: [servlets] Re: Can't compile a class
Anthony
Try compiling with:
javac -classpath /var/tomcat4/common/lib/servlet.jar HelloWorld.java
(ensure that the location of the servlet.jar is correct and the java file is
correct).
This should include the servlet api for your compilation. For a permanent
solution, ensure that your classpath includes
"/var/tomcat4/common/lib/servlet.jar" - try printing the classpath to the
screen to verify that it is correctly set and ensure that there are no
typos.
Hope this helps,
Andrew
Professional Java Servlets 2.3
http://www.amazon.com/exec/obidos/ASIN/186100561X
http://www.amazon.co.uk/exec/obidos/ASIN/186100561X
-----Original Message-----
From: Anthony J. Bravo [mailto:anthony_bravo@a...]
Sent: 18 June 2002 19:55
To: Servlets
Subject: [servlets] Re: Can't compile a class
Yes I have tried that. The only way I can get it to compile is if I use
Visual Cafe. In that environment I was able to set the path for the
servlet.jar and it picked it up just fine. But, as soon as I try to use
the command line it won't compile. It just doesn't make any sense.
-----Original Message-----
From: David Mitchell [mailto:dave@d...]
Sent: Tuesday, June 18, 2002 11:38 AM
To: Servlets
Subject: [servlets] Re: Can't compile a class
Anthony J. Bravo wrote:
> Hello,
>
> I am trying to learn about java servlets and the way they work. I
> have recently installed the necessary files under linux and have
> gotten tomcat to work with apache. I also have java 1.4 installed
> with the proper path settings. Today I have tried to compile
> a simple helloworld example and I get errors during the process. It
> says that it cannot find the javax.servlet package and of course says
> it can't resolve symbols of the servlet class. I set my path to include
> the following: /var/tomcat4/common/lib. This points to the servlet.jar
> file so I don't know what I am doing wrong. Can someone please help me.
>
> Thanks,
> Anthony
Anthony,
Not sure about Tomcat on Linux, but I know on Windows, you have to add
the direct path to servlet.jar to your CLASSPATH. Have you tried that?
Dave
--
David Mitchell
http://java.dbmdata.com