This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

importing package not being recognised

 
Paul Mackellar
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am trying to compile a servlet which has an imported package.



and this is the imported package



when i try to compile i am getting the following errors and can't work it out.



can anyone help?
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try to add the folder where the "com" package is to your classpath :
javac -cp src -d classes src/com/example/web/BeerSelect.java

Also, you'll need to add the servlets api jar file to your classpath. Check this FAQ.
 
Paul Mackellar
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Christophe Verré wrote:Try to add the folder where the "com" package is to your classpath :
javac -cp src -d classes src/com/example/web/BeerSelect.java

Also, you'll need to add the servlets api jar file to your classpath. Check this FAQ.


Thanks that worked
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic