Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Doubt from head first

 
Sonam Zam
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
servlet-api.jar:classes:.

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;.
 
Thuwaragan Sundaramoorthy
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
try using semicolon [ ; ] instead of colon[ : ] as the path separator (if you are working on windows environment).
[ October 11, 2007: Message edited by: Sundaramoorthy Thuwaragan ]
 
Sonam Zam
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thank you very much friends.
it worked!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic