Setup
To set up your environment:
You must use Java 7. If you don't have Java 7, download and install it.
Set your
JAVA_HOMEenvironment variable to the path of your JDK installation. If you are abashuser, the following considerations apply:For a typical Linux installation, add a line similar to the following to your
.bashrcfile:
export JAVA_HOME=/usr/local/tools/java/jdk1.7.0_45.jdkIf you use Mac OS X and the default Terminal app, your shell session doesn't load
.bashrcby default. So you may need to add a line similar to the following to your.bash_profile:
[ -r ~/.bashrc ] && source ~/.bashrcIf you use Mac OS X but don't use the default terminal app, for example, you use a terminal management app such as tmux, you may need to add a line similar to the following line to your
.bashrcfile:
export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/HomeIf you don't have Maven installed, download and install Maven.
Creating an App Engine backend for deployment
You'll need to create a new Google Cloud Platform Console project for your backend, and you'll need to create client IDs for client.
Creating a new project
In the Cloud Platform Console, go to the Projects page.
Select a project, or click Create Project to create a new Cloud Platform Console project.
In the dialog, name your project. Make a note of your generated project ID.
Click Create to create a new project.
Creating OAuth 2.0 client IDs for the backend
Open the Credentials page for your project, and select Web application as the application type.
Fill out the form that is displayed:
Specify a name for the web client.
Specify
http://localhost:8080in the textbox labeled Authorized JavaScript origins, because you'll be running this locally.
Click Create.
Note the client ID that is generated. This is the client ID you need to use in your backend and in your client application. You can always return to the Credentials page to view the client ID.
Creating a Simple Hello World Backend API >>
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 3.0 License, and code samples are licensed under the Apache 2.0 License. For details, see our Site Policies.
Java is a registered trademark of Oracle and/or its affiliates.
Last updated January 14, 2016.