• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Knute Snortum
  • Bear Bibeault
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Frits Walraven
  • Carey Brown
  • Tim Holloway

Basic doubt in compiling servlets

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi
I am studying head first java .In the starting pages of compiling a java file they gave command

%javac -classpath /your path/tomcat/common/lib/
servlet-api.jar -d classes src/Ch1Servlet.java


I could actually compile java file through editors but when i try to compile using command prompt i got %javac as not recognized command .if i remove % then i get

javac: invalid flag: Files\Apache
Usage: javac <options> <source files>
use -help for a list of possible options


i gave command as
javac -classpath C:\Program Files\Apache Software Foundation\Tomcat 5.0\common\lib\servlet-api.jar -d classes src\Ch1Servlet.java and i set the correct directory path also

Expecting a reply .
 
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The problem seems to be caused by the white spaces you have in your class path to Tomcat.

Try enclose your path in double quotes.
 
srinivas venkat
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thank you very much that solved my problem
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!