Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
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


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "Compile Servlet" Watch "Compile Servlet" New topic
Author

Compile Servlet

priya rishi
Ranch Hand

Joined: Oct 26, 2008
Posts: 119
hello,
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\Ch1Servlet.java

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


SCJP 5 , SCWCD 5
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14687
    
  16

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\Ch1Servlet.java


[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.


 
jQuery in Action, 2nd edition
 
subject: Compile Servlet
 
Similar Threads
ben..............tomcat is not installing
apache tomcat is arrogant...........huh
error compiling a servlet
problem working on Servlets..plz help..
problem in compiling servlet