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


  1. Install Eclipse IDE for Java Developers, version 4.5 or newer:

    Download Eclipse

  2. Run Eclipse.

  3. Download and install the Cloud Tools for Eclipse Plugin from the Eclipse Marketplace.

    From inside Eclipse, Select Help > Eclipse Marketplace... and search for Google Cloud.

    Search for Google Cloud in the Eclipse Marketplace


  1. Make sure that the following software is installed on your local system:

  2. From inside IDEA, open File > Settings. Or, on Mac OS X, open IntelliJ IDEA > Preferences.

  3. In the navigation pane, select Plugins.
  4. Click Browse repositories.
  5. In the dialog that opens, select Google Cloud Tools.
  6. Click Install.
  7. Click Close.
  8. Click OK in the Settings dialog.
  9. Click Restart. Cloud Tools can be found in Tools > Google Cloud Tools
  10. Configure the Cloud SDK location:
    1. Open File > Settings or on Mac OS X open IntelliJ IDEA > Preferences.
    2. In the left navigation pane Choose Google > Cloud SDK or Other Settings > Google > Cloud SDK.
    3. If the path to the Cloud SDK directory is blank, browse to the location where you installed the Cloud SDK. To find the location of your Cloud SDK installation, run gcloud info and add it to your environment's PATH variable.
    4. Click OK.
  11. 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 SDK is missing, click New... and choose a Java 8 SDK.


  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. Type a name for the project and (optionally) a Java package.

  4. Set Maven to handle folder structure creation and dependencies "Create as Maven Project" and enter a Maven group ID and artifact ID.

  5. Select the libraries (App Engine API, App Engine Endpoints, and Objectify) to include in the project.

  6. Click Finish.

Eclipse creates a skeleton project with a preset class that can be modified in the usual way.


To create a new project, you can use the IntelliJ New Project wizard to generate a template application that you can use as the start for your own application.

Create a new project as follows:

  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 box for Google App Engine Standard.

  4. Verify that the Cloud SDK directory field displays the correct path to where you installed the Cloud SDK.

    1. If the path is incorrect, click the ellipsis (...) to navigate to the correct location.
  5. Choose additional libraries you want to add to the classpath of your application. The Servlet API is selected by default.

  6. When finished, click Next.

  7. Enter a Project name.

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

  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 ''
        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
    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 GCP 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.

Send feedback about...

App Engine standard environment for Java