~/Downloads/client_secrets.json)
to src/main/resources/client_secrets.json.
private static final String projectId = "YOUR_PROJECT_ID"is updated to your Project ID (otherwise you will get a
400 Bad Request "Invalid value 'YOUR_PROJECT_ID'" error response).
For more information see setting your project ID
Prerequisites: install Java 6, Mercurial and Maven. You may need to
set your
JAVA_HOME
.
cd [someDirectory] hg clone https://code.google.com/p/google-api-java-client.samples/ google-api-java-client-samples cd google-api-java-client-samples/compute-engine-cmdline-sample cp ~/Downloads/client_secrets.json src/main/resources/client_secrets.json [editor] src/main/java/com/google/api/services/samples/computeengine/cmdline/ComputeEngineSample.java mvn compile mvn -q exec:java
To enable logging of HTTP requests and responses (highly recommended when developing), please take a look at logging.properties.
Prerequisites: install Eclipse, the Mercurial plugin, and the Maven plugin.
compute-engine-cmdline-sample project
[someDirectory]/google-api-java-client-samples/compute-engine-cmdline-sample
and click "Next"