This document describes how to locally run and debug an App Engine standard application from within IntelliJ IDEA.
Before you begin
Follow the Quickstart to install and set up IntelliJ IDEA, Ultimate Edition.
Install the Google Cloud SDK Java Extensions:
gcloud components install app-engine-java
Ensure your application is an App Engine standard project that contains an
Running your application locally
To run an App Engine application locally, do the following:
Choose File > Open to open the project you want to run.
Browse to the directory containing your project.
Choose Tools > Google Cloud Tools > Run on a local App Engine Standard dev server.
The project takes a moment to build.
Editing the run configuration
You can edit the run configuration for your local server as follows:
Choose Run > Edit Configurations.
Update configuration settings as needed. Some common ones include:
- Artifact to deploy
- App Engine Host
- App Engine Port
When finished, click OK.
Stopping the server
To stop the Dev App Server, choose Run > Stop 'Google App Engine Standard Local Server'.
Debugging the application
You can use the run configuration you previously created to run your application in debug mode as follows:
Choose Run > Debug.
In the dialog, click Google App Engine Standard Local Server.
After the project builds, you can set breakpoints to debug your app.
IntelliJ Community Edition does not provide native support for running local Java servlet-based applications. To run your application locally using IntelliJ Community Edition, configure your project as a Maven or Gradle based project by using the Maven or Gradle plugins.
These guides also include instructions on configuring the development server for debugging. Connecting your debugger is as simple as configuring an IntelliJ remote debug configuration.
Once your Gradle or Maven project is properly configured, you can start the local server from the Gradle or Maven toolbox in the margin of your IDE.
Make sure that the port number is the same as the port in the VM options you configured in your Gradle or Maven App Engine plugin configuration. Port 5005 is the default.