File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Basic doubt in compiling servlets

 
srinivas venkat
Greenhorn
Posts: 8
  • 0
  • 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 .
 
mark benz
Greenhorn
Posts: 15
  • 0
  • 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
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thank you very much that solved my problem
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic