Thursday, January 21, 2010

Configuring Eclipse to use GWT within a Grails project

One nice thing about Eclipse is that it sets up your environments, compile macros and build paths for you when you do, say, File > New > Grails Project. GWT has a similar setup that works just as well and in exactly the same way. However, I'm merging Grails and GWT functionality and want the benefits of code completion, etc.

As mentioned in a previous blog entry, however, the merging of GWT and Grails is not very straightforward and is subject to some idiosyncrasies, including the need to execute Grails commands from a terminal and not from within Eclipse.  For some reason, installing GWT plugins from within Eclipse does not work (my theory has to do with environment variables but I just gave up on it and went with the sure-fire way).

The net effect is that GWT auto-suggest doesn't work.  Nor does auto-creation of import statements.  Bleh.  I found that you can get the former to work fine by right-clicking on the Project name in Package Explorer, then Google > Web Toolkit Settings...  You get the following screen:



Check "Use Google Web Toolkit" then auto-complete (at least) will work.

1 comment:

  1. Hi. There is nice article for starters.

    http://waqarsherbhatti.posterous.com/installing-and-configuring-google-web-toolkit

    ReplyDelete