Getting Started: Setting Up Your Development Environment

Learn how to set up your build environment for app development and deployment to Google App Engine Standard. The supported Java development and build environments are IntelliJ IDEA, Eclipse, Apache Maven, and Gradle.

This guide will show you how to:

  • Install the Google Cloud SDK command-line tool.
  • Install and configure App Engine plugins for Eclipse, IntelliJ, Gradle, and Maven.
  • Create a new App Engine project.

Installing required SDKs

  1. If you haven't already installed Java SE 8 SDK, install the Java SE 8 Development Kit (JDK).

  2. Install the latest version of the Google Cloud SDK.

    Install Google Cloud SDK

  3. Install the App Engine Java component:

    gcloud components install app-engine-java
  4. Authorize your user account:

    gcloud auth application-default login
  5. Optionally, to create a service account run gcloud auth activate-service-account --key-file=your_key.json. For more information, see Authorizing Cloud SDK Tools.

Configuring your development environment


Before you begin:

  1. Install Eclipse IDE for Java EE Developers, version 4.7 or later:

    Download Eclipse

  2. If you have the Google Plugin for Eclipse installed, complete the migrating from GPE procedures.

Install the plugin:

  1. Drag the install button into your running Eclipse workspace:

    Drag to your running Eclipse workspace.

    Or from inside Eclipse, select Help > Eclipse Marketplace... and search for Google Cloud Tools for Eclipse.

  2. Restart Eclipse when prompted.


Before you begin:

  1. Sign in to your Google Account.

    If you don't already have one, sign up for a new account.

  2. In the Cloud Console, on the project selector page, select or create a Cloud project.

    Go to the project selector page

  3. Make sure that billing is enabled for your Google Cloud project. Learn how to confirm billing is enabled for your project.

  4. Ensure that the following software is installed on your local system:

Install the plugin:

  1. From inside IDEA, open File > Settings. Or, on Mac OS X, open IntelliJ IDEA > Preferences.
  2. Select Plugins from the navigation pane and search for Cloud Code.
  3. Click Install.
  4. Choose to Restart your IDE.
  5. Configure the project JDK:
    1. Open File > Project Structure. Or on Mac OS X open IntelliJ IDEA > Project Structure.
    2. Choose Project Settings > Project.
    3. If the Project JDK is missing, click New... and choose a JDK.


  1. Install Gradle v3.4.1 or newer

  2. Install git


  1. Download Maven 3.5 from the Maven website.

  2. Install Maven 3.5 on your local machine.

Creating a new App Engine project


  1. Click the Google Cloud Platform toolbar button .

  2. Select Create New Project > Google App Engine Standard Java Project.

  3. Enter a Project name and (optionally) a Java package.

  4. To create a Maven-based App Engine project, check Create as Maven Project and enter a Maven Group ID and Artifact ID.

  5. Click Next.

  6. Select any libraries you need in the project.

  7. Click Finish.

The wizard generates a native Eclipse project, with a simple servlet, that you can run and deploy from the IDE.


  1. Choose File > New > Project to display the New Project dialog.

  2. Choose Java in the left panel.

  3. In the Additional Libraries and Frameworks section, check the Google App Engine box for your environment.

  4. Select the additional libraries you want to add to the classpath of your application. The Servlet API is selected by default.

  5. Click Next.

  6. Enter a Project name.

  7. Enter a Project location if you do not want to keep the default.

  8. Update the fields in the More Settings section if you do not want to keep the defaults.

  9. Click Finish.


  1. Create a new directory.

  2. Initialize the new project in the created directory:

    gradle init --type java-library;
    mkdir -p src/main/webapp/WEB-INF;
    rm src/main/java/ src/test/java/

    Gradle will create a skeleton directory structure with two empty classes that are removed in the final rm command.

  3. Add the following to your build.gradle file to add App Engine Gradle tasks, Maven repositories, the App Engine Gradle plugin, dependencies, and task configuration:

    buildscript {      // Configuration for building
      repositories {
        jcenter()      // Bintray's repository - a fast Maven Central mirror & more
      dependencies {
        classpath '' // Latest 1.x.x release
        classpath 'org.akhikhl.gretty:gretty:+'
    repositories {   // repositories for JARs you access in your code
      maven {
        url ''             // Google's mirror of Maven Central
    //maven {
    //  url '' // SNAPSHOT repository if needed
    apply plugin: 'java'
    apply plugin: 'war'
    apply plugin: 'org.akhikhl.gretty'
    apply plugin: ''
    dependencies {
      providedCompile 'javax.servlet:javax.servlet-api:3.1.0'
      providedCompile ''
    // Add your dependencies here.
    gretty {
        httpPort = 8080
        contextPath = '/'
        servletContainer = 'jetty9'  // What App Engine Flexible uses
    appengine {
      deploy {   // deploy configuration
        stopPreviousVersion = true  // default - stop the current version
        promote = true              // default - & make this the current version
        projectId = 'GCLOUD_CONFIG' // delegate to project in gcloud config
        version = 'GCLOUD_CONFIG'   // delegate to gcloud to generate a version
    group = 'com.example.appengine'   // Generated output GroupId
    version = '1.0-SNAPSHOT'          // Version in generated output
    sourceCompatibility = 1.8
    targetCompatibility = 1.8


To create an App Engine App:

  1. Create a new directory.

  2. Initialise the new project in the created directory:

     mvn archetype:generate -Dappengine-version=1.9.59 -Djava8=true -DCloudSDK_Tooling=true -Dapplication-id=your-app-id
    1. Set -Dappengine-version to the most recent version of the App Engine SDK for Java, and application-id to the ID of your Cloud project.

    2. Set -Djava8=true to deploy the project in the Java 8 runtime.

    3. Set -DCloudSDK_Tooling=true to use Cloud SDK tooling.

  3. When prompted to choose an archetype, choose the value 2 for the App Engine skeleton archetype. This creates an empty project that contains the required directory structure and files.

  4. When prompted for version, press ENTER to select the default most recent version.

  5. When prompted to Define value for property 'groupId', supply the desired namespace for your app; for example, com.mycompany.myapp.

  6. When prompted to Define value for property 'artifactId', supply the project name; for example, myapp.

  7. When prompted to Define value for property 'version', accept the default value.

  8. When prompted to Define value for property 'package', supply your preferred package name (or accept the default). The generated Java files will have the package name you specify here.

  9. When prompted to confirm your choices, accept the default value (Y).

  10. Wait for the project to finish generating, then change directories to the new project directory, for example myapp/.

  11. Add the Cloud SDK-based plugin to your project's pom.xml file.

  12. Specify the target Google Cloud Platform project ID and the service and version in the plugin configuration.

What's next

Now that your development environment is set up, you can get started with developing and deploying Java apps to App Engine.