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

Problem Compiling Beer servlet example in HF

 
thomas jacob
Ranch Hand
Posts: 91
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am not able to compile the servlet BeerSelect which imports a BeerExpert java class. I have the BeerExpert class in the com/example folder. Looks like the package class BeerExpert cannot be found by the compiler. Do i have to include the classpath for the BeerExpert class in the classpath?.

The command i used to compile the servlet BeerSelect is as follows:
javac -classpath "C:\Program Files\Apache Software Foundation\Tomcat 5.0\common\lib\servlet-api.jar" classes -d classes src/com/example/web/BeerSelect.java

Please suggest

regards
jacob
 
John Ewing
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is what worked for me:

javac -classpath "C:\Program Files\Apache Software Foundation\Tomcat 5.5\common\lib\servlet-api.jar;classes;." -d classes src/com/example/web/BeerSelect.java
 
thomas jacob
Ranch Hand
Posts: 91
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks it works fine. By adding ;classes;. are we adding the java classes under classes folder.

Regards
Jigo
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic