Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Compiling servlets

 
Jamed
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic