You develop and upload Java applications for Google App Engine using the App Engine Java software development kit (SDK).
The SDK includes software for a web server that you can run on your own computer to test your Java applications. The server simulates all of the App Engine services, including a local version of the datastore, Google Accounts, and the ability to fetch URLs and send email from your computer using the App Engine APIs.
When App Engine runs your Java application, it uses the Java 7 virtual machine (JVM) and standard libraries. You should use Java 7 for compiling and testing your application to ensure that the local server behaves similarly to App Engine.
Warning: Applications that use Java 6 need to be migrated to Java 7. Existing applications that use the Java 6 runtime will continue to work, but updating these applications will require a whitelist request.
Once the JDK is installed, run the following commands from a command prompt
(for Windows, Command Prompt; for Mac OS X, Terminal) to determine which version is installed. If you have Java 7
installed, these commands will report a version number similar to
java -version javac -version
Using Eclipse and the Google Plugin for Eclipse
If you are using the Eclipse development environment, the easiest way to develop, test and upload App Engine apps is to use the Google Plugin for Eclipse. The plugin includes everything you need to build, test and deploy your app, entirely within Eclipse.
Using Apache Ant
If you want to compile and run your application using the command line, or an IDE other than Eclipse, you will need to install something to manage this process. Apache Ant is one such solution. Full directions on installing and setting up Apache Ant to work with App Engine can be found at Using Apache Ant.
Getting the SDK
If you are using Eclipse and the Google Plugin, you can install the App Engine SDK from Eclipse using Software Update. If you are not using Eclipse or the Google Plugin, you can download the App Engine Java SDK as a Zip archive. Unpack the archive in a convenient location on your hard drive.
Note: Unpacking the archive creates a directory whose
name is something like
X.X.X is the SDK version number. Throughout this documentation,
this directory will be referred to as
appengine-java-sdk/. You may
want to rename the directory after unpacking.
Trying a Demo Application
The App Engine Java SDK includes several demo applications in the
demos/ directory. The final version of the guest book application
you will create in this tutorial is included under the directory
guestbook/. This demo has been precompiled for you so you can try
it right away.
If you are using Eclipse, the SDK is located in your Eclipse installation
VERSION is a version identifier for the SDK. From the
command line, change the current working directory to this directory to run the
following command. If you're using Mac OS X or Linux, you may need to give the
command files executable permissions before you can run them (such as with the
chmod u+x dev_appserver.sh).
If you are using Windows, start the guest book demo in the development server by running the following command at a command prompt:
If you are using Mac OS X or Linux, run the following command:
The development server starts, and listens for requests on port 8080. Visit the following URL in your browser:
Note: When you start the development server from within
Eclipse using the Google Plugin for Eclipse (discussed later), the server uses
8888 by default:
For more information about running the development web server from the command line, including how to change which port it uses, see the Dev Web Server reference.
To stop the server, make sure the command prompt window is active, then press Control-C.
The development environment lets you develop and test complete App Engine applications on your computer. Let's start with a simple project.
Continue to Creating a Project.