Hi, I have downloaded Tomcat4 and have got it run. But when I tried to compile Java servlet file, it gave errors like HelloWorld.java:4: package javax.servlet does not exist import javax.servlet.*; my jdk is in c:\jdk1.3.1, tomcat is in c:\tomcat4, JAVA_HOME=c:\jdk1.3.1 and TOMCAT_HOME=c:\tomcat4. And I already setup CLASSPATH=.\;C:\JDK1.3.1\LIB\TOOLS.JAR\; I searched this site's related threads, they talked about setting up classpath also to CLASSPATH=c:/tomcat/lib/servlet.jar ,But I can not find the servlet.jar file in the correspond directory c:/tomcat4/lib/, What should I do? Can you please give me some advice? Any reply is highly appreciated!
Yup, you need those classes, but they can be found in either servlet.jar or j2ee.jar Servlet.jar should already exist in TOMCAT_HOME/common/lib and you can add this to your classpath or drop servlet.jar in your JAVA_HOME/lib directory Dave.
Kathy: I had this problem too. You know what! I pulled half of my hair out to solve this problem. Please follow as bellow you will have less pain. Copy servlet.jar file from tomcat4\common\lib\[copy file servlet.jar] and paste it at jdk1.3\jre\lib\ext\[paste at here servlet.jar file]. It will solve your package javax.servlet does not exist import javax.servlet.*; By the way, Have you try tomcat sample servlet examples? Are they running? If they are you are all set, now rock and roll. Otherwise you got to set calsspath for CATALINA_HOME = tomcat4.0 . My best advise for all these go through tomcat docs. It takes time but comes out. I wish there were book like "Tomcat Installation for Dummies", I would have been first guy to reserve first copy of their first publication. It was lot pain. I do not want to see other people marching this route. If you need more information keep posting. GOOD LUCK. BK
Hi, HelloWorld.java:4: package javax.servlet does not exist import javax.servlet.*;
Joined: Sep 06, 2001
Thanks Dave and BK! BK, I did run the sample servlet, they did not run either. You mean I need to add: set classpath=c:\tomcat4; ? If there were a book "Tomcat Installation for Dummies", I will do the same thing as you. But right now, I will follow your advice and keep reading the tomcatdocs. Thanks again.
SET JAVA_HOME=C:\JDK1.3 SET CATALINA_HOME=C:\TOMCAT4.0 SET PATH=%JAVA_HOME%\BIN;%CATALINA_HOME%\BIN; SET CLASSPATH=%CLASSPATH%;C:\mydir\servlet.jar; Startup.bat Now check as: localhost:8080 Tomcat's index page must be there.. Write me back if any problem.
------------------ I am before you to see you!!!
I am before you to see you!!!
subject: new to Tomcat and JSP&Java Servlet,pls help