Skip to content

Commit 67fdcc0

Browse files
author
Ajay Kannan
committed
fix order of project ID lookup, cleanup
1 parent c084250 commit 67fdcc0

File tree

1 file changed

+9
-12
lines changed

1 file changed

+9
-12
lines changed

README.md

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ Example Applications
3737
- [`StorageExample`](https://github.com/GoogleCloudPlatform/gcloud-java/blob/master/gcloud-java-examples/src/main/java/com/google/gcloud/examples/StorageExample.java) - A simple command line interface providing some of Cloud Storage's functionality
3838
- Read more about using this application on the [`gcloud-java-examples` docs page](http://googlecloudplatform.github.io/gcloud-java/apidocs/?com/google/gcloud/examples/StorageExample.html).
3939

40-
Specifying a Project
41-
--------------------
40+
Specifying a Project ID
41+
-----------------------
4242

4343
Most `gcloud-java` libraries require a project ID. There are multiple ways to specify this project ID.
4444

@@ -49,11 +49,7 @@ Most `gcloud-java` libraries require a project ID. There are multiple ways to s
4949
```java
5050
Datastore datastore = DatastoreOptions.builder().projectId("PROJECT_ID").build().service();
5151
```
52-
* Specify the environment variable `GCLOUD_PROJECT`. For example, type the following into command line:
53-
54-
```bash
55-
export GCLOUD_PROJECT=PROJECT_ID
56-
```
52+
* Specify the environment variable `GCLOUD_PROJECT` to be your desired project ID.
5753
* Set the project ID using the [Google Cloud SDK](https://cloud.google.com/sdk/?hl=en). To use the SDK, [download the SDK](https://cloud.google.com/sdk/?hl=en) if you haven't already, and set the project ID from the command line. For example:
5854

5955
```
@@ -62,10 +58,11 @@ Most `gcloud-java` libraries require a project ID. There are multiple ways to s
6258

6359
`gcloud-java` determines the project ID from the following sources in the listed order, stopping once it finds a value:
6460

65-
1. Project ID supplied when building the service options.
66-
2. Project ID specified by the environment variable `GCLOUD_PROJECT`.
67-
3. Project ID used by App Engine.
68-
4. Project ID specified in the Google Cloud SDK.
61+
1. Project ID supplied when building the service options
62+
2. Project ID specified by the environment variable `GCLOUD_PROJECT`
63+
3. App Engine project ID
64+
4. Compute Engine project ID
65+
5. Google Cloud SDK project ID
6966

7067
Authentication
7168
--------------
@@ -86,7 +83,7 @@ There are multiple ways to authenticate to use Google Cloud services.
8683
.build()
8784
.service();
8885
```
89-
* If running locally for development/testing, you can use use Google Cloud SDK. Download the SDK if you haven't already, then login using the SDK (`gcloud auth login` in command line). Be sure your current project is set correctly by running `gcloud config set project PROJECT_ID`.
86+
* If running locally for development/testing, you can use use Google Cloud SDK. Download the SDK if you haven't already, then login using the SDK (`gcloud auth login` in command line). Be sure to set your project ID as described above.
9087
9188
`gcloud-java` looks for credentials in the following order, stopping once it finds credentials:
9289

0 commit comments

Comments
 (0)