Eclipse Tomcat

eclipse

https://wolfpaulus.com/journal/mac/tomcat8/
http://crunchify.com/how-to-increase-tomcat-heapsize-jvm-heap-in-eclipse-ede/
http://crunchify.com/step-by-step-guide-to-enable-https-or-ssl-correct-way-on-apache-tomcat-server-port-8443/
http://crunchify.com/eclipse-how-to-fix-installing-apache-tomcat-server-issue-blank-server-name-field/
http://crunchify.com/error-starting-apache-tomcat-server-the-jre-could-not-be-found-edit-the-server-and-change-the-jre-location/
http://crunchify.com/how-to-start-stop-apache-tomcat-server-via-command-line-setup-as-windows-service/
http://crunchify.com/how-to-run-multiple-tomcat-instances-on-one-server/

What are the overall steps that we must do in order to use Tomcat inside Eclipse?

  1. Download and install Tomcat (see the tomcat-linux page)
  2. Add Tomcat to Eclipse

How can add Tomcat to Eclipse?

You must be using a version of Eclipse that included WTP, which is the plug-in responsible for managing embedded servers, such as Tomcat. I recommend eclipse-indigo, for stability - but newer JEE Eclipse versions should work as well - here's a link to the indigo version: http://www.eclipse.org/downloads/download.php?file=/technology/epp/downloads/release/indigo/SR2/eclipse-jee-indigo-SR2-win32-x86_64.zip

I also recommend overriding some of the eclipse.ini settings, such as setting these: -Xms64m / -Xmx2048m

It's also a good idea to use a JDK to run Eclipse, instead of a basic JVM - you can add something like this to your eclipse.ini:

-vm C:/dev/tools/jdk17u45/bin/javaw.exe

Add these classpath variables (Preferences > Java > Build Path > Classpath Variables):

  • TOMCAT_JDK = C:/dev/tools/jdk17u25/ (or whatever path to your working JDK)
  • PARSERS_DIR=(path to the 'parsers' directory in your project's codebase)

To add Tomcat to Eclipse:

  1. Click on Windows -> Show View -> Servers
  2. Right click anywhere in the Servers view and select "New -> Server"
  3. Drill down on Apache
  4. Select appropriate version of Tomcat
  5. Click Next
  6. Specify the location where we previously installed Tomcat
  7. Click Finish

Now, we can stop and start Tomcat from inside the Servers view. After we made change to our code, we can right click on the project and select "Run As -> Run on Server". If we double-click on the server under the Servers tab, it should display a page where we can configure the server. One of the option would allow us to live reload the class when we save it without us having to do a manual deploy.

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License