Wednesday, April 18, 2012

Setting up a new GWT Web Project with Eclipse

Download and Install Eclipse
Official Site: http://www.eclipse.org/

You can download Eclipse from the Eclipse download page (currently Indigo):
http://www.eclipse.org/downloads/

I suggest that you download the Eclipse IDE for Java EE Developers. This version contains everything you need.

Copy Eclipse to Program Files Folder
Once the zipfile is downloaded open it and copy the contents (the eclipse directory) in to your C:\Windows\Program Files folder or your prefered location for the Eclipse binaries.

I usually then click on to the eclipse.exe binary and move it to my taskbar to have it available.

Once finished start Eclipse. The first time you start Eclipse it will ask you where to put your projects. I usually create a folder in Documents named Eclipse Projects.

Install Android SDK
Official Site:  http://developer.android.com/index.html

The GWT application is spitting out an error about missing dependencies when you want to use the Android GWT libraries. Therefore it is recommended to install the Android SDK first. If you don't want to do that you can simply untick the Android GWT libraries.

Download the Android SDK from following URL:
http://developer.android.com/sdk/index.html

I have downloaded the Windows Installer executed it and clicked through the menus.

As next step it is required to install the ADT plugin. The ADT (Android Development Tools) plugin is connecting the Eclipse editor with the SDK.

Click on to Help -> Install new Software

Paste following URL in to the Work with field:
https://dl-ssl.google.com/android/eclipse/
 
Click on to the Add button

Enter  ADT Plugin as name and click Ok

Tick Developer Tools and click Next


You see some details click Next


Accept the Terms and click Finish


In the middle of the installation you'll be warned that the plugin is not signed. This is fine. Just click Ok

You will be asked to restart Eclipse. Click the Restart now button


When finished Eclipse will restart and after the restart you'll have to choose which SDK to take. I just took the newest one. Click Next.

I don't want to send Usage Statistics to Google. So I disabled it. Click Finish.


Click Install to install all the libraries.


Install Google AppEngine & GWT & SDKs
Official Site AppEngine: https://developers.google.com/appengine/
Official Site GWT: https://developers.google.com/web-toolkit/

Next step is to install Google AppEngine. If you haven't done so sign up to AppEngine first using the following link:
https://developers.google.com/appengine/

Download the Google AppEngine SDK
Download the Google AppEngine SDK and unzip it on to your hard drive. Doesn't matter where. Usually I keep all my Java libraries like JRE and JDK in a folder called Java within the Program Files folder. This is also the location to where I put the AppEngine SDK.

Now it's time to install the AppEngine & GWT plugins. For this it's the same procedure again as above.

Click on to Help -> Install new Software
Paste following URL in to the Work with field:
http://dl.google.com/eclipse/plugin/3.7

Click on to the Add button

Enter  GWT as name and click Ok

Tick all the libraries and click Next


You see some information. Click Next


Accept the Terms and click Finish


In the middle of the installation you'll be warned that the plugin is not signed. This is fine. Just click Ok


You will be asked to restart Eclipse. Click the Restart now button


Once Eclipse has restarted you can register with your AppEngine (Gmail account)


Once you have signed in successfully this part is completed and we can move on.

Install GWTP (gwt-platform)
Official site: http://code.google.com/p/gwt-platform/

A very nice addon to GWT is the GWTP plugin. This will help you to create Model-View-Presenter based code. It basically sets up all the wiring between classes for you.

Click on to Help -> Install new Software
Paste following URL in to the Work with field:
http://plugin.gwt-platform.googlecode.com/hg/update

Click on to the Add button

Enter GWTP as name and click Ok

Tick all the libraries and click Next


You see some information. Click Next


Accept the Terms and click Finish


In the middle of the installation you'll be warned that the plugin is not signed. This is fine. Just click Ok


You will be asked to restart Eclipse. Click the Restart now button 


There is a very nice Video to get you started with GWTP:

Some nice Eclipse Shortcuts
Ctrl + Shift + R - This will open a search panel. Search for classes to open them all in Eclipse.

No comments:

Post a Comment