Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Eclipse with Tomcat

 
Scott Burnett
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • 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
 
Lasse Koskela
author
Sheriff
Posts: 11962
5
  • Mark post as helpful
  • send pies
  • 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
  • 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
 
Ilja Preuss
author
Sheriff
Posts: 14112
  • Mark post as helpful
  • send pies
  • 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!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic