Featured image

This article is dedicated to all people who are still developing on internal Jetty server and do not know how to run their product on Apache Tomcat server. This guide is valid for * Eclipse IDE* (Currently: v4.5 MARS).

First of all, if you are not familiar with SuperDevMode and its prerequisites, please check the official docs at http://www.gwtproject.org.

How does one start SuperDevMode on Apache Tomcat server? It’s easy like a pie! 🙂 Just follow these simple steps:

Setup Instructions Link to heading

  1. Prerequisites: I assume you already have Tomcat server installed on your local machine

  2. Create Run Configuration: Click the right mouse button on your GWT project and then go to Run As → Run Configurations…

  3. New Java Application: Create a new launcher for Java Application in the open window

  4. Main Configuration: In the tab menu choose Main and type your project name (i.e. MySuperProject) or select it with the Browse button. Type in the Main Class text box com.google.gwt.dev.codeserver.CodeServer without quotation marks

  5. Program Arguments: Switch to the Arguments tab and set Program Arguments according to your project like this: -src src/ com.example.company.gwt.EntryPointClass -port 8900

    • First argument -src src/ should point at your project source directory
    • Second argument com.example.company.gwt.EntryPointClass should contain your GWT main entry package and class name
    • Third argument -port 8900 indicates your port selection for the SuperDevMode running instance
  6. VM Arguments: In the VM Arguments section type whatever you want to be used as arguments by JVM. Normally, my argument settings would look like -Xmx2048m -Xms1024m -XX:MaxPermSize=1024M

  7. Add CodeServer JAR: Switch to the Classpath tab and select User Entries there. Then click on Add JARs… and go to your GWT SDK folder. Select one of jars named gwt-codeserver.jar

  8. Start SuperDevMode: Now click Apply button and Run. Your SuperDevMode is now starting on localhost port 8900 (or whatever you selected in the arguments above)

Running Your Application Link to heading

  1. Setup Bookmarks: Once it started, navigate to http://localhost:8900/ and follow the step-by-step guide for setting bookmarks, which will appear automatically

  2. Deploy to Tomcat: Now right click on your project and go to Run As… → Run on Server to run your project on Tomcat server

  3. Access Your Application: Finally, navigate to your Tomcat mount path with your main HTML page. This page already contains your GWT javascript: http://localhost:8080/MySuperProject/MySuperProject/index.html. Click on previously bookmarked link to enable GWT Dev Mode ON

  4. Compile and Test: A dialog window pops up with one Compile button. After a while the page will be refreshed and you will be able to see your updated project

  5. Happy Developing: Happy developing with SuperDevMode!

Additional Resources Link to heading

For additional information please visit SuperDevMode page at gwtproject.org