• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

Problem Compiling Beer servlet example in HF

 
Ranch Hand
Posts: 91
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks it works fine. By adding ;classes;. are we adding the java classes under classes folder.

Regards
Jigo
 
Warning! Way too comfortable! Do not sit! Try reading this tiny ad instead:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic