title: Setting GOOGLE_APPLICATION_CREDENTIALS still doesn't enable the access to Google Storage
body: <p><a href="https://stackoverflow.com/a/45121635/4983501">This answer</a> shows how to access Google Cloud Storage with a service account in Java.<br>
  Using <strong>hard-coded</strong> Service Account Credentials, I <strong>could</strong> access GCS.
  However, using <code>GOOGLE_APPLICATION_CREDENTIALS</code> or running <code>gcloud auth application-default login</code>, I <strong>couldn't</strong> access GCS and got <code>GoogleJsonResponseException: 401 Unauthorized</code>.<br>
  My OS is Win7_64x.</p>
  
  <pre><code>Exception in thread "main" com.google.cloud.storage.StorageException: Anonymous caller does not have storage.objects.get access to nmjcloud_jar_test/addons/simple-bean-1.0.jar.
      at com.google.cloud.storage.spi.v1.HttpStorageRpc.translate(HttpStorageRpc.java:191)
      at com.google.cloud.storage.spi.v1.HttpStorageRpc.get(HttpStorageRpc.java:342)
      at com.google.cloud.storage.StorageImpl$5.call(StorageImpl.java:198)
      at com.google.cloud.storage.StorageImpl$5.call(StorageImpl.java:195)
      at com.google.api.gax.retrying.DirectRetryingExecutor.submit(DirectRetryingExecutor.java:89)
      at com.google.cloud.RetryHelper.run(RetryHelper.java:74)
      at com.google.cloud.RetryHelper.runWithRetries(RetryHelper.java:51)
      at com.google.cloud.storage.StorageImpl.get(StorageImpl.java:195)
      at com.google.cloud.storage.StorageImpl.get(StorageImpl.java:209)
      at com.example.storage.QuickstartSample.main(QuickstartSample.java:47)
  Caused by: com.google.api.client.googleapis.json.GoogleJsonResponseException: 401 Unauthorized
  {
    "code" : 401,
    "errors" : [ {
      "domain" : "global",
      "location" : "Authorization",
      "locationType" : "header",
      "message" : "Anonymous caller does not have storage.objects.get access to nmjcloud_jar_test/addons/simple-bean-1.0.jar.",
      "reason" : "required"
    } ],
    "message" : "Anonymous caller does not have storage.objects.get access to nmjcloud_jar_test/addons/simple-bean-1.0.jar."
  }
      at com.google.api.client.googleapis.json.GoogleJsonResponseException.from(GoogleJsonResponseException.java:146)
      at com.google.api.client.googleapis.services.json.AbstractGoogleJsonClientRequest.newExceptionOnError(AbstractGoogleJsonClientRequest.java:113)
      at com.google.api.client.googleapis.services.json.AbstractGoogleJsonClientRequest.newExceptionOnError(AbstractGoogleJsonClientRequest.java:40)
      at com.google.api.client.googleapis.services.AbstractGoogleClientRequest$1.interceptResponse(AbstractGoogleClientRequest.java:321)
      at com.google.api.client.http.HttpRequest.execute(HttpRequest.java:1065)
      at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:419)
      at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:352)
      at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.execute(AbstractGoogleClientRequest.java:469)
      at com.google.cloud.storage.spi.v1.HttpStorageRpc.get(HttpStorageRpc.java:340)
      ... 8 more
  </code></pre>
  
  <p>How can I check where I was wrong?</p>