How to add a Tomcat server in Eclipse

Home > Search > How-to
  by

If Tomcat is not already installed on the machine running Eclipse:

  1. In Eclipse, select Window > Preferences.
  2. Expand Server and select Runtime Enviornments.
  3. Select Add.
  4. Select one of the Tomcat servers and select Next.
  5. Select Download and Install.
  6. Select Next.
  7. Select Finish.

 


Add one or more servers to Eclipse will let you run your Eclipse project on a server in the Eclipse IDE, instead of having to export and deploy your project to a server.

  1. In Eclipse , select File > New > Other.
  2. Expand Server, select Server, and select Next.

 

  1. Select the type of server and select Next, and enter the hostname of your server. 

 

  1. Enter the path to the server. This assumes that the server is installed on the same machine as Eclipse. Select Finish.

 

 

A new directory and files will be created under your eclipse-workspace/Servers directory. For example, if your eclipse-workspace/Servers directory is located at /home/john.doe/eclipse-worspace/Servers, and you add a server named Tomcat v8.0 Server, the follow directory and files will be created on the Eclipse server.

  • /home/john.doe/eclipse-workspace/Servers/Tomcat v8.0 Server/catalina.policy
  • /home/john.doe/eclipse-workspace/Servers/Tomcat v8.0 Server/catalina.properties
  • /home/john.doe/eclipse-workspace/Servers/Tomcat v8.0 Server/context.xml
  • /home/john.doe/eclipse-workspace/Servers/Tomcat v8.0 Server/server.xml
  • /home/john.doe/eclipse-workspace/Servers/Tomcat v8.0 Server/tomcat-users.xml
  • /home/john.doe/eclipse-workspace/Servers/Tomcat v8.0 Server/web.xml

 

Now when creating a Dynamic Web Project in Eclipse, there will an option in the Target runtime drop-down for the server you added.



Add a Comment




We will never share your name or email with anyone. Enter your email if you would like to be notified when we respond to your comment.




Please enter in the box below so that we can be sure you are a human.




Comments