This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Java Interview Guide and have Anthony DePalma on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes Basic doubt in compiling servlets Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Basic doubt in compiling servlets" Watch "Basic doubt in compiling servlets" New topic

Basic doubt in compiling servlets

srinivas venkat

Joined: Aug 19, 2009
Posts: 8
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/

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\ and i set the correct directory path also

Expecting a reply .
mark benz

Joined: Aug 18, 2009
Posts: 15
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

Joined: Aug 19, 2009
Posts: 8
thank you very much that solved my problem
I agree. Here's the link:
subject: Basic doubt in compiling servlets
It's not a secret anymore!