Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Compiling a servlet

 
Nikhil Jain
Ranch Hand
Posts: 392
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Ranchers,

In HFS book, one of the chapters gives the following syntax to compile the servlet

%javac -classpath /yourpath/tomcat/common/lib/servlet-api.jar -d classes src/ch1servelet.java

Project1
--Src -> Ch1Servlet.java
--classes
--etc -> web.xml

when we compile this the class file lands in the Project1-Classes folder automatically, but we did not specify this path. How does this happend...

please help!

Thanks
 
Marc Peabody
pie sneak
Sheriff
Posts: 4727
Mac Ruby VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
-d classes sets the destinationation directory to the classes folder.

It's pretty safe to say the javac command is being called from the Project1 folder.
 
Ashley Bideau
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
when we compile this the class file lands in the Project1-Classes folder automatically, but we did not specify this path. How does this happend...


Thats why clearing SCJP 5.0 is so fun

-Ashley
SCJP 5.0
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic