Monday 28 December 2009

Upgrade to GWT 2

To upgrade the Eclipse Plugin to GWT 2, is an easy process. Unfortunately GWT is installed with the default name, GWT, GWT (1), GWT (2) and so on, for any different release. Ideally, the name used is a meaning full one, such as GWT 1.7.1 and GWT 2.0.0.

In this short article we discuss who to rename an existing GWT Eclipse Plugin and install GWT 2

Rename the existing GWT Eclipse Plugin

This step is optional.

By default, the GWT Eclipse plugin is installed with the name GWT as shown in the following figure. This can be misleading especially if you have multiple versions installed. Unfortunately, the name cannot be changed once installed. The only way to rename it is to remove it and then add it again with the proper name.

To rename the GWT Eclipse Plugin, please follow the steps below:

  1. From the menu, open Window > Preferences
  2. Expand the Google node and select the Web Toolkit

    As you can notice, the name set to GWT.
  3. Select it and click the Remove button
  4. Once removed, click the Add button
  5. A dialog will open. Click the Browse button to locate the current GWT Eclipse plugin

  6. Browse to the GWT Eclipse plugin folder. This is usually found at: C:\Program Files\Eclipse\eclipse-jee-galileo-SR1-win32\plugins\com.google.gwt.eclipse.sdkbundle.win32_1.7.1.v200909221731\gwt-windows-1.7.1.

    Note that the version numbers may be different depending on the version you have installed.

  7. Set the display name to correspond to the version, GWT X.X.X, and press OK

  8. Press OK to complete the process

This complete the renaming process.

Install the GWT 2 Eclipse plugin

This is installed as any other new Eclipse plugin.

  1. From the menu, open Help > Install New Software.... Make sure to select the Install New Software... and NOT Check for Updates
  2. Select the Google Eclipse URL: http://dl.google.com/eclipse/plugin/3.5 (for Eclipse 3.5), check both the Plugin and SDK options and press Next as shown in the image below.

  3. Next, Next, ..., Next through the installation. Once ready, restart Eclipse.

The GWT 2 Eclipse plugin is installed, with the name GWT. It is recommended to rename it to GWT 2.0.0 following the steps above discussed.

Draft Compile

One of the new features available in GWT2 is the draft compile, which is ideal for development as it skips the optimisation processes carried out by the compiler reducing the compile time. This is a great feature for development, but the production code SHOULD NOT be compiled in this mode.

To make use of this feature, simple add the -draftCompile to the advance compiler options as illustrated below.

1 comment: