How to configure Apache Tomcat in Eclipse IDE?

5 May 2012 By Nithya Vasudevan 81,238 views 10 Comments
17 Flares Twitter 0 Facebook 16 Google+ 1 17 Flares ×

Apache Tomcat (or simply Tomcat) is an open source web server and Servlet container developed by the Apache Software Foundation (ASF). Tomcat implements the Java Servlet and the JavaServer Pages (JSP) specifications. This can be managed manually or configured in any IDE.

This tutorial provides step by step explanation of how to configure Apache Tomcat in Eclipse IDE.

Environment Used

  • JDK 6 (Java SE 6)
  • Eclipse Indigo IDE for Java EE Developers (3.7.1)
  • Apache Tomcat 6.x
  • Windows OS/Ubuntu OS

Installing JDK

JDK should be installed with proper environment set up. Read this page for installing the JDK and setting up the environment. Installing JDK automatically installs JRE.

Installing Eclipse IDE

We use Eclipse IDE throughout this tutorial. If you need to install Eclipse, you can read this page.

Installing Apache Tomcat

Tomcat should be installed before configuring it in Eclipse IDE. If you need to install Apache Tomcat, you can read this page.

Configuring Apache Tomcat in Eclipse IDE

The step for configuring Apache Tomcat in Eclipse IDE is similar for Windows and Ubuntu OS.

Open Eclipse IDE

Add Server

Make sure you are in Java EE perspective and in “Servers” area, right click -> New -> Server.

Here you will see list of servers that can be configured in the installed Eclipse IDE version. You will find Tomcat v6.0 Server under “Apache” folder as shown below.

Select “Tomcat v6.0 Server” and click Next.

Configuring Apache Tomcat installation location

Select the Tomcat Root folder which has bin folder and click Next.

There are no resources to be configured and hence click Finish.
The configured Apache Tomcat Server will be displayed in the “Servers” view.

Start Server

It is easy to manage the server instance. Right-click on the server and start and stop it to ensure its proper working.

Test your installation

After starting the Tomcat, open browser and type http://localhost:8080. You should see the Apache Tomcat home page as shown below.

Tags: , , , , , ,

  • Ms. Yuta Lolap

    i am not able to see that page of apache. It is asking me for username and password. I am using Apache tomcat 7.0. Plus i am also getting the error struts2 resource not found. please help.

  • http://theopentutorials.com/tutorials/java-ee/how-to-configure-apache-tomcat-in-eclipse-ide/ PRATIVA BEHERA

    go to above mentioned web site ,you will get your result.

  • http://theopentutorials.com/tutorials/java-ee/how-to-configure-apache-tomcat-in-eclipse-ide/ PRATIVA BEHERA

    Yes, I am able to see the Apache Tomcat home page as shown above. This really works.This website is very helpful.

  • arjuna

    These Eclipse configuration steps are awesome and i am able to do it in few seconds.

  • YOGI

    HI MADAM
    HAPPY EVENING
    THANK YOU VERY MUCH FOR PROVIDING THESE WONDERFUL DETAILS
    I HAVE INSTALLED JDK,ECLIPSE JDK AND TOMCAT SUCCESSFULLY
    THE LAST STEP IS CONFIGURING TOMCAT IN ECLIPSE.WHEN I OPEN ECLIPSE I AM UNABLE TO FIND THE SERVER LIST.PLEASE GUIDE ME IN THIS MATTER

  • raju

    Thanks. This is detailed and useful tutorial.

  • aditya

    can we run servlet programm without using ecclips

  • Pingback: Eclipse Apache Tomcat Kurulumu | Recep Dur

  • ramesh

    Jun 29, 2014 6:41:37 PM org.apache.catalina.core.AprLifecycleListener init
    INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:Program FilesJavajre1.7.0_09bin;C:WindowsSunJavabin;C:Windowssystem32;C:Windows;C:/Program Files/Java/jdk1.5.0_06/bin/../jre/bin/client;C:/Program Files/Java/jdk1.5.0_06/bin/../jre/bin;C:/Program Files/Java/jdk1.5.0_06/bin/../jre/lib/i386;C:Program FilesJavajdk1.5.0_06bin;C:eclipse-SDK-3.7-win32eclipse;;.
    Jun 29, 2014 6:41:38 PM org.apache.coyote.http11.Http11Protocol init
    INFO: Initializing Coyote HTTP/1.1 on http-8080
    Jun 29, 2014 6:41:38 PM org.apache.catalina.startup.Catalina load
    INFO: Initialization processed in 490 ms
    Jun 29, 2014 6:41:38 PM org.apache.catalina.core.StandardService start
    INFO: Starting service Catalina
    Jun 29, 2014 6:41:38 PM org.apache.catalina.core.StandardEngine start
    INFO: Starting Servlet Engine: Apache Tomcat/6.0.41
    Jun 29, 2014 6:41:38 PM org.apache.coyote.http11.Http11Protocol start
    INFO: Starting Coyote HTTP/1.1 on http-8080
    Jun 29, 2014 6:41:38 PM org.apache.jk.common.ChannelSocket init
    INFO: JK: ajp13 listening on /0.0.0.0:8009
    Jun 29, 2014 6:41:38 PM org.apache.jk.server.JkMain start
    INFO: Jk running ID=0 time=0/30 config=null
    Jun 29, 2014 6:41:38 PM org.apache.catalina.startup.Catalina start
    INFO: Server startup in 312 ms

  • ramesh

    this is my probleam when i configure tomcat6 in eclipse ide