Friday, October 23, 2009

Eclipse+Grails+GWT: Integrating 'live' GWT [1]

After creating a Grails project in Eclipse (and a plugin), I want now to make use of GWT (Google Web Toolkit). For doing so I am going first to install the useful Google plugin for Eclipse (download). As I am working with Eclipse Galileo, I am installing the software using: http://dl.google.com/eclipse/plugin/3.5

If you are new to GWT I would suggest you to start creating a simple GWT project (without any Grails involved). Follow this.

Adding the gwt libraries to the classpath of the Grails project
If you installed the Eclipse plugin for GWT this would be a fairly simple step. Right click on the project and Properties->Java Build Path->Libraries->Add Library and I will find in the list the Google Web Toolkit in the list (this is obviously because I previously succesfully installed the Eclipse plugin for GWT).

An alternative way (to the Google plugin) would have been to define in the Eclipse Preferences->Java->Build Path->Classpath Variables the variable GWT_HOME that will point to the gwt installation (i.e. /Users/paolociccarese/Library/gwt-mac-1.7.1). If you haven't installed GWT yet, you can download it here. Then we are going to add to the libraries of the 'FirstApp' projects the jars included in the GWT distribution (Right click on the project and Properties->Java Build Path->Libraries->Add variable you can select GWT_HOME and extend it with the jars: gwt-api-checker, gwt-dev-mac, gwt-servlet, gwt-user.

Another way would be using ivy for resolving the dependencies.

The Grails plugin for GWT
Then I will install the Grails plugin for GWT. Once again, after positioning in the root of the 'FirstApp' project I will type:
> grails install-plugin gwt

At this point I am almost ready to go...



No comments: