• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Eclipse with Tomcat

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
Before I compiled with MultiEdit and run under Tomcat
I am now trying to import my current webapp into Eclipse which I am intending to use. Everything has gone well apart from the fact of resolving the servlet stuff.
My problem is that when I try to build my project I get the compile error
"HttpServlet cannot be resolved or is not a valid superclass"
I have tried adding the servlet.jar from Tomcat's common\lib as an external JAR in the Java Build Path, even tried putting it in the ClassPath Variables under 'Windows>Preferences"
Also having add the import statement (which I didn't need to before when compiling under MultiEdit.
I obviously only want to build against the .class in the servlet.jar and not include any source
I know this is a pretty basic question - but its now fustrating me and stopping me from exploring Eclipse
Can anyone help ? Had their own problem with this ?

Thanks,
ScottyB
 
author
Posts: 11962
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It sounds like you've done everything correctly (adding servlet.jar as "external JAR" through (project)Properties > Java Build Path > Libraries.
 
Scott Burnett
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, thanks for the reply.
Upon further investigation I have now realised that Eclispse does not save the source as default when you hit rebuild all ! - D'oh
So I had actually done the right thing - was just stupidly assuming that it saved the amended source :-(
Scott
 
author
Posts: 14112
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Scott Burnett:
Hi, thanks for the reply.
Upon further investigation I have now realised that Eclispse does not save the source as default when you hit rebuild all ! - D'oh
So I had actually done the right thing - was just stupidly assuming that it saved the amended source :-(


Actually, Eclipse works the other way around per default: it compiles your source automatically when you save the file!
 
reply
    Bookmark Topic Watch Topic
  • New Topic