August 16th, 2001, 06:30 PM
Problems in compling Servlets
Hi there i am having problems trying to compile servlets even those that are examples found in the tomcat directory. The jdk am using is able to compile any other type of classes but not that classes that require the packag javax.servlet infact when compiling it, it says it doesnt exist !.
I am using tomcat 4.0 beta 7 and JDK ver 1.4 on a Windows 2000 machine. When typing http://127.0.0.1:8080/ the tomcat page appears and when attempting to run the ready made servlets evverything is normal however problem is compiling them.
My server settings are as follows :-
1) Windows 2000- Environment settings (System Variables)-
CATALINA_HOME- C:\Program Files\Tomcat4.0
JAVA_HOME - C:\jdk1.4
CLASSPATH - C:\jdk1.4\bin\tools.jar;C:\Program Files\Tomcat4\lib\servlet.jar;%CLASSPATH%
PATH - C:\jdk1.4\bin;C:\Program Files\Tomcat4
2) Javac commands functions normally and the connection to the server from http://127.0.0.1:8080 works fine.
3) Error obtained after attempting to compile :-
HelloWorld.java:2: package javax.servlet does not exist
Therefore throughout the script every class within this package is regarded as an error.
Can any one help solve this problem or help reconfigure the server ??
Apperciate ur help !!
August 20th, 2001, 12:44 PM
Umm I might be wrong here but did you make sure you downloaded the servlet packages from Sun's website?
Look for java servlets under product and you'll find a link. Extract the jar file to your JDK directory and then add it to your classpath. Restart your computer and it should work.
Let me know if it doesn't
August 29th, 2001, 01:00 AM
I might be wrong. To me it seems that your path does not cover the Tomcat4/lib/ . So it may not find servlet.jar.