Extract both of them where you prefer. I extracted Eclipse in /opt/eclipse and Tomcat in /opt/tomcat6), then run Eclipse.
When you’ll run eclipse it asks you about creating a new workspace (that will be used to store all of your projects), so create a workspace, usually somewhere in your user home directory.
When Eclipse is up and running, choose preferences from the window menu. Choose from the bar on the left: Server, Runtime Environments.
Click the button Add, choose Apache Tomcat 6.
In the next page, browse on your disk and choose the directory where you previously extracted Tomcat. In my case it’s /opt/tomcat6. Finally click Finish.
Well, until now we have just told to our workspace where Tomcat “installation” is located on our disk.
But, if we wish to run Java Web Applications within Eclipse, we should setup a Server and eventually assign to it a specific configuration.
Go in the Servers view, right click and choose New, then Server.
Select “Tomcat v6.0 Server” as server type (or probably it will be automatically pre-selected), then, in the Server Runtime environment select box you’ll have to choose “Apache Tomcat v6.0” (that’s probably the only available option.
Click on Next, Eclipse will prompt you to eventually add (or remove) web projects from this Server, in this case, if your workspace is empty you’ll have not any project to add. So, click Finish.
In the Servers panel, you will see the Tomcat you just added, and in the Project Explorer view, a new Server configuration will magical appear.
So you can edit the configuration file
server.xml as you prefer, change AJP or HTTP connector ports and so on, start/stop/debug the server and obviously add and remove projects from it.
It is also possible to add other server “instances”, just right click again in the “Servers” view, and follow the procedure described before.
In this way, you will just a single “Tomcat” binaries location (that you defined in the first step of this tutorial), but you’ll have the chance to add many instances of that server, each of them with its specific configuration (imagine the
/conf directory of Tomcat) and its specific web application (imagine the
For the more expert ones, it is similar to have more instances on the same tomcat binaries defined on different
I hope this tutorial has been useful, please post any question or comment.