Thursday, June 24, 2010

Google AppEngine – Hello World Example

The best thing about Google AppEngine is you can run your java web-application in Google infrastructure for FREE of cost (up to certain user hits).I was really excited to know this, because it's really a great opportunity to deliver lots of small web utility at free of cost.
Let's get started:

Installing Eclipse AppEngine plugin:

              Google provided Eclipse plugin for developing & deploying AppEngine application easily. Based on the Eclipse version we need to select different update site URL, in our example I am using Eclipse 3.5 (Galileo) so i am using update site URL  as

Steps 01:

In Eclipse, select Help menu and click "Install new Software" option as below.

Step 02:

Once the Wizard opens, click Add button. Below pop-up box should be displayed where you have to enter the update URL (based on the Eclipse version) and a unique name. Then click ok.

Step 03:

Below windows screen should be displayed, where SDK and plugin files are displayed. Check both check boxs and click Next.

Now Eclipse connect to the server and downloads the files, once the files are downloaded it displays license agreement page, once you have agreed to that, it starts installing the files and request you to restart the eclipse .After restarting  the eclipse, you should see below new icons in your eclipse top left corner.

Creating Application:

Click on google icon, which will open below application creation wizard.


Project Name:  Name of the project.

Package Name: you have to specify the default package name, based on this your files are created under the given packages.

Apart from that, it also supports GWT supports, currently we can ignore the GWT support option and we should select only AppEngine Support.Click Finish.

Default Project:

Once you click finish, plugin will create a default project skeleton, where you will have directory structure which is required by google appengine."war" is the deployment folder, where all your dynamic files and static files should be placed.

Debugging the Application:

Right click the project, select "dubug as" and select Web Application option.Now the code should compiles and then eclipse starts the server. You can view the application using URL http://localhost:8888/<application-name>

Deploy Application:

Once you done with the debugging, it's time to deploy the application. Select icon and eclipse pops-up below dialog box.

Click "App Engine project Settings" option, which open the windows where the application ID should be entered. If you are creating first time then click "My application" option which pop-up the browser and lands in creation of application Id.

Click "OK", now you will be back to the previous screen, now enter your password. Once you enter the password the Google AppEngine will connect to the server and the files are deployed.

Once the Eclipse finishes the deployment, now you can access the Hello world example in the below URL <Application_ID><project_name> example:

That's it, now the hello world application is live in Google infrastructure.Please post your comments, if you think some thing can be added ;)...


This content comes from a hidden element on this page.

The inline option preserves bound JavaScript events and changes, and it puts the content back where it came from when it is closed.
Click me, it will be preserved!

If you try to open a new ColorBox while it is already open, it will update itself with the new content.

Updating Content Example:
Click here to load new content