Sunday, October 23, 2011

How To Create A Website Using Google Web Toolkit And App Engine

Install Sun Java JRE and JDK:

https://help.ubuntu.com/community/Java

  • Installing Sun Java from the command line

$sudo apt-get install sun-java6-jre sun-java6-bin sun-java6-jdk sun-java6-plugin sun-java6-fonts

  • Choosing the default Java to use

$sudo update-alternatives --config java

  • Then, choose Sun Java

Download and install Eclipse:

http://www.eclipse.org/downloads

  • Choose Eclipse IDE for Java EE Developers.

Set-up JDK in Eclipse:

  • Window->Preferences->Java->Installed JREs.
  • Click Add, Standard VM->JRE Home, click Directory and choose:
/usr/lib/jvm/java-6-sun, then click Finish.
  • Check java-6-sun.

Install Google Web Toolkit and Google App Engine Plug-ins:

  • Help->Install New Software->Click Add, and Use this URL To Download:

http://dl.google.com/eclipse/plugin/3.7

  • To install GWT, use this URL:

http://download.eclipse.org/webtools/repository/indigo

Now, that everything have been set-up, create a new project:
  • First, you must have a Google Account using Google App Engine.
  • Then, sign-in in Eclipse at the bottom left.
  • In Eclipse, File->New->Web Application Project.
  • Fill-in Project Name and Package, click Finish.
  • Right-click on the created project in the Project Explorer->Google->Deploy to App Engine (This may take awhile).
  • To run the web app, right-click the project->Debug As->Web Application.

You will see a link to launch a web browser. You need to install Google Chrome for debugging, and install the Chrome Web Toolkit Plugin.

  • Add the Browser: Window->Preferences->General->Web Browser. Chrome is located here: /usr/bin/google-chrome.
  • Double-click the link when debugging, then run Chrome.

You will see it's default web application.  

Congratulations!
Here's the link on how to Set-up Eclipse for Google Web Toolkit:

http://code.google.com/webtoolkit/gettingstarted.html

Next blog post, we'll do some coding.


No comments: