I am having trouble with what is probably the most basic of issues involving Tomcat 5.5.17.
I am using javac to compile a servlet and it is not able to find the packages javax.servlet.* javax.servlet.http.* java.io.*
I am trying to compile the servlet code from the Head First Servlet & JSP book (page 80). I am almost positive that the problem is that the packages above cannot be found because I receive the same errors when compiling without the servlet-api.jar
I am typing the command for javac, as provided on page 81, except that tomcat is my root directory. My os is WinXP.
I have tried your suggestions and have not been able to solve the problem. I agree that the problem is not directly related to Tomcat. It's just a matter of the servlet-api.jar being in the tomcat\common\lib directory.
I am using the javac command essentially as suggested in the HFSJSP book. Here it is. Is something wrong here, or is there something else for me to check? Thanks.
my BeerSelect.java file is in the e:\myProjects\BeerV1 directory and I have made that directory the current directory.
1.) On windows systems, the delimter is a semi-colon ";", not a colon ":".
2.) Why is there a backslash at the beginning? Starting a path with a backslash on windows means "go to the root of this drive then look for a directory named "f:", then look for one named "tomcat" etc.
Also, just to clarify... Your subject line is misleading.
It should be "javac not finding classes" not "tomcat not finding classes"
Joined: Apr 26, 2006
As you stated, the problem was related to using a colon instead of a semicolon. And, yes, your suggestion for the wording of the problem is more appropriate.
I passed the SCJP by relying completely on an IDE. As a result, command-line issues were something of a weak area for me. I've decided to use the command-line for the SCWCD, at least until I really am familiar with the various options.