File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes Compiling servlets Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "Compiling servlets" Watch "Compiling servlets" New topic
Author

Compiling servlets

Jamed
Ranch Hand

Joined: Apr 17, 2005
Posts: 35
Hallo everyone,

I've just started reading the HFS book.

I am right into the first appliction of the 1st chapter ( page 30 $ 31)

i can't complie the serlet

in step 5 what should be "/your path/" ?

i don't know what to put in your path. i tried everything possible but still it didn't work

this is the location of tomcat on my machine

E:\Program Files\Apache Software Foundation\Tomcat 5.5

1.what should i put in there?

2.They claim that they have all code examples on this page. this is not true
http://www.wickedlysmart.com/HeadFirst/HeadFirstServlets/HeadFirstJavaServlets.html
is there a way to get a soft copy of the code examples at least?

thanks in advace guys,

jamed
[ May 01, 2005: Message edited by: Moh'd Al Jamed ]
saiprasad raut
Ranch Hand

Joined: Aug 29, 2003
Posts: 40
Hi,
I have also faced the same problem. In that case i copied the servlet-api.jar file in my c:\ root folder and then complied the servlet as

javac -classpath c:\servlet-api.jar Servlet.java

Just try this out....
Jamed
Ranch Hand

Joined: Apr 17, 2005
Posts: 35
I figured it out

D:\project1>javac -classpath "E:\Program Files\Apache Software Foundation\Tomcat 5.5\lib\servlet-api.jar" -d classes src\Ch1Servlet.java

the trick here with the spaces in the path ! windows can't recongnize spaces ! that's why you need to use double qoutes around the path

regards,

Jamed
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Compiling servlets