hi friends. i m trying to compile my servlet (given in head first servlets and jsp, page no. 81) but when i give the path javac -classpath "<my system path>\Tomcat 5.0\common\lib\servlet-api.jar:classes:." -d classes src\com\example\web\BeerSelect.java
it does not identify the javax.servlet and javax.servlet.http packages and throws numourous errors. but when i write javac -classpath "<my system path>\Tomcat 5.0\common\lib\servlet-api.jar" -d classes src\com\example\web\BeerSelect.java
my servlet got compiled. could you please tell me what is the segnificance of writing "servlet-api.jar:classes:." in your path as my servlet compiles with "servlet-api.jar" i am new to tomcat as well as servlets. kindly help.
This is the Unix annotation, to tell the compiler to use servlet-api.jar, as well as every classes in the "classes" directory, and in the current directory. If you are compiling in Windows, you have to separate them with semi-colons, not colons. -> servlet-api.jar;classes;.