English
Skip to page content Skip to main navigation

e.g. "templates" or "datastore"

# Installing the Java SDK

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.

## Getting Java

Google App Engine supports Java 5 and Java 6. When your Java application is running on App Engine, it runs using the Java 6 virtual machine (JVM) and standard libraries. Ideally, you should use Java 6 for compiling and testing your application to ensure that the local server behaves similarly to App Engine.

For developers that don't have easy access to Java 6 (such as developers using Mac OS X), the App Engine SDK is compatible with Java 5. You can upload compiled classes and JARs made with Java 5 to App Engine.

If necessary, download and install the Java SE Development Kit (JDK) for your platform. Mac users, see Apple's Java developer site to download and install the latest version of the Java Developer Kit available for Mac OS X.

Once the JDK is installed, run the following commands from a command prompt (for Windows, Command Prompt; for Mac OS X, Terminal) to verify that you can run the commands, and to determine which version is installed. If you have Java 6 installed, these commands will report a version number similar to `1.6.0`. If you have Java 5 installed, the version number will be similar to `1.5.0`.

    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.

The plugin is available for Eclipse versions 3.3 and 3.4. You can install the plugin using the Software Update feature of Eclipse. The installation locations are as follows:

- The Google Plugin for Eclipse, for Eclipse 3.3 (Europa):

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

- The Google Plugin for Eclipse, for Eclipse 3.4 (Ganymede):

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

For details on how to use Software Update to install the plugin, and how to create a new project, see Using the Google Eclipse Plugin.

## 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 haven't already, install the "Google App Engine Java SDK" component using the locations above.

If you are not using Eclipse or the Google Plugin, you can download the App Engine Java SDK as a Zip archive.

Download the App Engine Java SDK. Unpack the archive in a convenient location on your hard drive.

Note: Unpacking the archive creates a directory whose name is something like `appengine-java-sdk-X.X.X`, where `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 directory, under `plugins/com.google.appengine.eclipse.sdkbundle_VERSION/`, where `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 command `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:

    appengine-java-sdk\bin\dev_appserver.cmd appengine-java-sdk\demos\guestbook\war

If you are using Mac OS X or Linux, run the following command:

    ./appengine-java-sdk/bin/dev_appserver.sh appengine-java-sdk/demos/guestbook/war

The development server starts, and listens for requests on port 8080. Visit the following URL in your browser:

- http://localhost:8080/

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.

## Next...

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.