my dog learned polymorphism
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes Compile Servlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "Compile Servlet" Watch "Compile Servlet" New topic

Compile Servlet

priya rishi
Ranch Hand

Joined: Oct 26, 2008
Posts: 119
i am studying hfsj chapter 1 and tried to compile demo in pg 30 of the book.

i am stuck there, where i have to compile

tomcat exists in this path --- C:\Tomcat5.0\Tomcat 5.0\common\lib

my javac command is : javac -classpath C:\Tomcat5.0\Tomcat 5.0\common\lib\servlet-api.jar -d classes src\

after this error message-invalid flag 5.0\common\lib\servlet-api.jar
any help is appreciated.

Christophe Verré

Joined: Nov 24, 2005
Posts: 14688

The command line doesn't like spaces in the path. Try again with : javac -classpath "C:\Tomcat5.0\Tomcat 5.0\common\lib\servlet-api.jar" -d classes src\

[My Blog]
All roads lead to JavaRanch
priya rishi
Ranch Hand

Joined: Oct 26, 2008
Posts: 119
Thanks, it compiles successfully.
now,i know the power of "" in classpath.

I agree. Here's the link:
subject: Compile Servlet
jQuery in Action, 3rd edition