My favorites | English | Sign in

Faster apps faster - GWT 2.0 with Speed Tracer New!

Google Plugin for Eclipse

Using Google Plugin for Eclipse with existing projects

The Google Plugin for Eclipse makes it easy to create new projects that use GWT and App Engine. It's also easy to set up your existing projects to make use of the plugin.

Importing your application into Eclipse

Create an Eclipse project for your source, if you haven't already done so, by selecting File > New > Java Project. Then choose Create project from existing source and set up your project. At this point, your source will be loaded in Eclipse, but the project's build path may not be set up properly, and you may see build errors.

Alternatively, if your application's source tree already contains a .project file, either because you had previously worked on it in Eclipse or because it was generated by a tool like GWT's webAppCreator, you can import the project by going to File > Import > General and selecting Existing Projects into Workspace.

Enabling Google SDKs if your project already has a "war" directory

To enable Google Web Toolkit, right-click your project and select Google > Web Toolkit Settings. Check the Use Google Web Toolkit box and click OK to apply the change.

Enabling App Engine for your project is similar: right-click your project and select Google > App Engine Settings. Check the Use Google App Engine box and click OK.

If your project depends on libraries not provided by the GWT and App Engine SDKs, put them in war/WEB-INF/lib and add them to your Java build path. This approach should work for most existing Java web applications, including server-side Java applications (such as those made from the App Engine template), and GWT 1.6 or later projects.

Working with GWT 1.5 and earlier projects

The Google Plugin for Eclipse and GWT 1.6 or later support project structures from previous versions of GWT, which expect HTML pages to live in a directory called public underneath a GWT module directory. If you're more comfortable using an existing GWT 1.5 SDK, that will work too. Just add it on the GWT Preferences Page. To do this, select Window > Preferences (or Eclipse > Preferences on the Mac) and navigate to Google > Web Toolkit.

However, we recommend upgrading to the new project layout and using the current GWT SDK, which is bundled with the plugin. See the GWT Upgrade Guide for instructions on how to migrate your layout. Once you've added the necessary files to your project and switched over to the new project layout, you'll need to follow the instructions below in order to have Eclipse pick up the changes:.

  1. Uncheck the Use Google Web Toolkit option for your project (right-click your project and select Google > Web Toolkit Settings and uncheck the box).
  2. Click OK to apply changes and close the Web Toolkit Settings dialog.
  3. Ensure that the project conforms to the new war style structure, as described in the upgrade guide.
  4. If you don't have continuous refresh enabled in your Eclipse configuration, refresh your project manually (either by pressing F5 or right-clicking your project and selecting refresh)
  5. Go back to the Web Toolkit Settings dialog for your project.
  6. Re-check the Use Google Web Toolkit option.
  7. Click OK to apply changes and close the Web Toolkit Settings dialog.