• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

Doubt from head first

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Sheriff
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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;.
 
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thank you very much friends.
it worked!
 
look! it's a bird! it's a plane! It's .... a teeny tiny ad
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic