Meaningless Drivel is fun!*
The moose likes IDEs, Version Control and other tools and the fly likes Eclipse with Tomcat Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Engineering » IDEs, Version Control and other tools
Bookmark "Eclipse with Tomcat" Watch "Eclipse with Tomcat" New topic
Author

Eclipse with Tomcat

Scott Burnett
Greenhorn

Joined: Feb 17, 2004
Posts: 3
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

Joined: Jan 23, 2002
Posts: 11962
    
    5
It sounds like you've done everything correctly (adding servlet.jar as "external JAR" through (project)Properties > Java Build Path > Libraries.


Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
Scott Burnett
Greenhorn

Joined: Feb 17, 2004
Posts: 3
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

Joined: Jul 11, 2001
Posts: 14112
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!


The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Eclipse with Tomcat
 
Similar Threads
Ant Undeploy Problem
New comer's qz
First servlet... plz help
custom tag
compiling servlets under Tomcat 4.0