Skip to content
Advertisement

Setting GCP environment variable in Spring boot with vs code

I’m trying to set up GOOGLE_APPLICATION_CREDENTIALS but keep getting this error

java.io.IOException: The Application Default Credentials are not available. They are available if running in Google Compute Engine. Otherwise, the environment variable GOOGLE_APPLICATION_CREDENTIALS must be defined pointing to a file defining the credential

I have defined in my application properties:

JavaScript

Added the dependency in the pom file:

JavaScript

Tried to do it from the terminal(windows) as well no luck:

JavaScript

Advertisement

Answer

Solved by running in the terminal:

JavaScript

In addition to setting the relevant role in IAM section of GCP since I’ve encountered a PERMISSION_DENIED Error after

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement