Configuring
Eclipse to work with Apache Tomcat Application server
These
installation instructions are from:
http://www.coreservlets.com/Apache-Tomcat-Tutorial/tomcat-7-with-eclipse.html
1.
If not already installed, download Java runtime environment from http://www.oracle.com/technetwork/java/javase/downloads/.
Use JDK for any Java 6 version. Servlet 3.0 containers (of which Tomcat 7 is one)
require Java 6, and will not work with Java 5. You want the full JDK (with
compiler), not just the JRE (for running existing apps). Accept all defaults when
installing.
2.
Download and unzip the pre-configured tomcat tomcat-7.0.8-preconfigured.zip into C:\ folder
3. Download Eclipse from http://www.eclipse.org/downloads/, choose version Eclipse IDE for Java EE Developers, 212 MB.
Extract into C:\ folder.
4. Start Eclipse. Create workspace in C:\web. Close the Welcome screen J.
5. Let Eclipse know about the tomcat. Go to tab Servers. New server wizard. Choose
Apache tomcat V7.0. Browse to the parent directory of your tomcat installation.
6. Test that everything works correctly. Download test-app.zip. Do not unzip.
7. Import this test application into Eclipse. Use File, Import,
General, Existing Projects, Select archive file. Then click Browse and navigate
to test-app.zip
8. Go to Servers tab, R-click, Add or remove: add test-app.
9. R-click - start tomcat server (or restart if already running).
10. Go to your browser and type: http://localhost/test-app/. The
application should work.
11. If you want to see other examples, usually supplied with
tomcat, copy folder C:\apache-tomcat-7.0.8\webapps\ROOT into C:\web\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps.
Override if asked.
12. Restart tomcat in eclipse. Check if test-app still works by
typing http://localhost/test-app/ in browser.
13. Type http://localhost/ in browser. You should see the general tomcat
startup page with all the examples.