How to add tomcat server to eclipse

When develope web application you usually want to add a tomcat server into eclipse for easier to debug in eclipse. But after a long time I forgot how to do this. Thanks myself for my habit to document everything that I think I will forget it. I have found it in a text note. So this note will guide step by step how to do.

At the Server tab you will see a link to create a new server.

Let’s try to click on it. The new server form display for you to define a new server. I select Tomcat v8.5 Server.

Click Add link to Specify the Tomcat Server installation directory

Click Next. Then oh no, you don’t see the web application to add to server.

In order to see the web application to add to server. Go to command line to run maven command. In this post I use Console2 opensource command line. You can use default cmd of window. Run this command:

mvn eclipse:clean eclipse:eclipse -Dwtpversion=2.0

Refresh project in eclipse then repeat below step. You can see the webapp has displayed to add.

Add it now

You will see new Servers has include in your project in eclipse and see the project has include in Tomcat like this:

Now you can start server in debug mode:

Done!

 

Leave a Reply

Your email address will not be published. Required fields are marked *