File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes IDEs, Version Control and other tools and the fly likes How to run servlet program in eclipse Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » IDEs, Version Control and other tools
Bookmark "How to run servlet program in eclipse" Watch "How to run servlet program in eclipse" New topic

How to run servlet program in eclipse

Raghu ram
Ranch Hand

Joined: Oct 19, 2007
Posts: 34
Hello Frnds,

Anybody tell me to run the servlet program in eclipse IDE. What are the files should be downloaded and tell me what are the steps to import tomcat web container into eclipse.
Jeanne Boyarsky
author & internet detective

Joined: May 26, 2003
Posts: 33102

Did you download the Tomcat Eclipse plugin yet?

[OCA 8 book] [Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
Muhammad Saifuddin
Ranch Hand

Joined: Dec 06, 2005
Posts: 1323

here is on

[Blog][Linkedin] How To Ask Questions On JavaRanch My OpenSource
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 15080

You don't need a special third-party plug-in for Eclipse to be able to control Tomcat from Eclipse.

Just install the Eclipse Java EE tools. You can do this using the update manager in Eclipse: Select Help / Software Updates / Find and Install, then choose "Search for new features to install" and click Next. Select "Europa Discovery Site" (for Eclipse 3.3) or "Callisto Discovery Site (for Eclipse 3.2) and click Finish. Eclipse starts searching for updates. You might need to select a mirror site. Choose one that is close to you.

When it's done searching, look in the list of updates and select J2EE Standard Tools (JST) and Web Standard Tools (WST). You might need to click "Select Required". Then click Finish and let Eclipse download and install the updates.

Note that instead of installing JST and WST through the update manager, you can also download the Eclipse IDE with those things pre-installed. Just download "Eclipse IDE for Java EE developers" from the Eclipse download page.

After installing and restarting Eclipse, select Window / Preferences. In the tree on the left choose Server / Installed Runtimes. On the right click the "Add" button, then select Apache / Apache Tomcat 6.0 (or a different version, depending on which Tomcat you are using). Click Next, and select the directory where you have Tomcat installed. Finally, click Finish and OK to close the preferences window.

Now you can make a Java EE project. Select File / New / Project... In the New Project selection window, choose Web / Dynamic Web Project. Enter the details for your project and let Eclipse create the new project.

After creating some JSPs in the WebContent directory of your project, right-click the project and select Run As / Run on Server. Select your Tomcat and click Finish. Eclipse now starts Tomcat and opens a browser inside Eclipse that points at the running Tomcat.

Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 8 API documentation
I agree. Here's the link:
subject: How to run servlet program in eclipse
jQuery in Action, 3rd edition