This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan 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 Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Basic doubt in compiling servlets" Watch "Basic doubt in compiling servlets" New topic
Author

Basic doubt in compiling servlets

srinivas venkat
Greenhorn

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

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
Greenhorn

Joined: Aug 19, 2009
Posts: 8
thank you very much that solved my problem
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Basic doubt in compiling servlets
 
Similar Threads
unable to use TOMCAT 5.5
How to compile java file in Tomcat ?
Error while compling
classpath help with examples
Unable to complie