Getting started with creating Java app on Google App engine – Guest Post by Dhwaneet Bhatt


This is a Guest Post by Dhwaneet Bhatt. He’s one awesome programmer and technologist with an innate ability to master any technical topic very quickly. Here’s his twitter profile:!/dhwaneetbhatt for you to able to connect with him.

If you searching for tutorial to get you started with python app on Google App engine. click here. And Here’s his post which would help you to get started with creating a java app on Google App engine:

1. We will be using Eclipse IDE to code a simple Java App for Google App Engine because it is very simple, the other option is building the application using Ant script, which involves a lot of code writing, and I prefer to keep things simple.

2. Download Eclipse from the following URL:

The App Engine has support for all the versions but we prefer to use the latest version, so download Eclipse Indigo (3.7.x). On the web page, download from the first link that reads “Eclipse IDE for Java EE Developers”. That will download Eclipse 3.7.x.

3. Extract eclipse and start, you will be prompted to create a workspace, create it anywhere you like and proceed.


4. Once in eclipse, we need to install the Google App Engine plugin. Go to Help->Install New Software, once there, enter the following URL in the “Work With” text box:

Note: 3.7 in the URL corresponds to the Eclipse version, if you are using some other version, change the last number according to that. Or you can visit this link that gives all the URLs:

Click on the “Add” button and this repository will be added to Eclipse. Next time you can directly use this repository name for downloading any Google related plugin. It will then download a list of plugins associated with this URL.


Select the options “Google Plugin for Eclipse 3.7” under Google Plugin for Eclipse and Google App Engine Java SDKunder SDKs. These are the basic tools required for deploying a simple app to App Engine.

Click Next (2 times), and Accept the Terms of Agreement (after reading of course) and then it will take a couple of minutes for the plugins to get installed. Go grab a cup of coffee.

5. After it is installed, Eclipse will prompt for restart. Restart the Eclipse.

6. Click on New -> Other… and from the list select “Web Application Project” under Google”, give a name for your project and a package structure, and untick Use Google Web Toolkit and click Finish.


7. Now comes the surprise, you don’t need to do anything now. Eclipse has already created all the files required for the Hello World App, but still, I will be taking them one by one so that you can understand the necessary steps for writing a custom app.

8. First comes the deployment descriptor (for people who are new to J2EE, I recommend reading about J2EE first), it is the file web.xml located in the location war/WEB-INF/web.xml.

[sourcecode language=”xml”]
<?xml version="1.0" encoding="utf-8"?>

<web-app xmlns:xsi=""



xsi:schemaLocation="" version="2.5">













The web.xml contains mapping for the default servlet created with the name DhwaneetbhattjavaappServlet, and its URL mapping. This is the URL which will allow the servlet to give a response. And index.html located under war/ is the first file to be loaded when the application is started.

9. The next file is a pretty simple HTML file that contains nothing but a simple link to call the servlet.

[sourcecode language=”html”]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">



<meta http-equiv="content-type" content="text/html; charset=UTF-8">

<title>Hello App Engine</title>



<h3>Hello App Engine!</h3>

<a href="dhwaneetbhattjavaapp">Servlet</a>



10. The next important file is the servlet itself – which responds to the request by the html file. The doGet method means that the request coming from the html file is a GET request. You can repond to a POST request by implementing the doPost method and changing the type of request coming from html form to POST.

[sourcecode language=”java”]
package com.dhwaneetbhatt.helloworldjavaapp;

import javax.servlet.http.*;

public class DhwaneetbhattjavaappServlet extends HttpServlet {
public void doGet(HttpServletRequest req, HttpServletResponse resp)
throws IOException {
resp.getWriter().println("Hello, world");

11. The last file is the appengine-web.xml file which is located in the WEB-INF/ directory. App Engine needs one additional configuration file to figure out how to deploy and run the application. This file includes the registered ID of your application (Eclipse creates this with an empty ID for you to fill in later), the version number of your application, and lists of files that ought to be treated as static files (such as images and CSS) and resource files (such as JSPs and other application data). In the tag, enter the name of your App Id that you had chosen while registering for the app previously.

[sourcecode language=”xml”]
<?xml version="1.0" encoding="utf-8"?>

<appengine-web-app xmlns="">




<property name="java.util.logging.config.file" value="WEB-INF/"/>



12. That’s about all the files we’ve covered. There are a couple of other files – configuration files in META-INF, file and a favicon file that are unimportant at the moment. As I said Keep it Simple.

13. Now we are ready for a test run. Right click on the project from the Project Explorer, Run As -> Web Application, it will start the server. The default port is 8888. Open any web browser, type http://localhost:8888, you web application will run.



14. Before you Deploy it to Google App Engine – you’ll need to create an application on Google App Engine and Get the App Id. Scroll to the bottom of the blog post for a step by step guide.

Now that we have tested the code on our machine, it is time to deploy it go Google App Engine. Right click on the project, Google -> Deploy to App Engine, login with your credentials and on the next screen that comes, click on Deploy.


15. Your app will be deployed on the App Engine. Open any browser and enter the URL: and you will have the “Hello, world” app ready for the world to access.

– Dhwaneet Bhatt


*Here’s a step by step Tutorial to create an application on Google App Engine and getting the app id: [from Source]

Now, let’s sign up for a Google App Engine Account with a Google account you may have. Part of the process includes verification via a code sent to your mobile device – so be ready to provide your mobile number. And every Google Account gets to deploy 10 applications with a Google App Engine admin account.

Now, To sign up for Google APP engine. Go to: and if you have a Google Apps account go to:<DOMAIN.COM>

Now, sign in with your Google account and you would be asked to verify your account:


FAQ for this process is here:

Now, once you successfully verify your account, you would see something like:


And click on create application and fill in the following details. For now, fill in the App ID and the App Title. Leave other options as default for now. And yes, please check the availability of your app id and this will also be your URL. The URL will take the


Scroll down and you will find a “create application”. please click on it. You will also see a message: “Application registered successfully”.

7 thoughts on “Getting started with creating Java app on Google App engine – Guest Post by Dhwaneet Bhatt

What do you think? Leave a comment below.