I have Google Compute Engine\'s Credentials file , renamed as key.json. The next step is to set the environment variable with name GOOGLE_APPLICATION_CREDENTIALS. But it say
If you are using a tomcat (although this is valid in any case), you have to search for "launch configuration", in the "environment" tab you can add the variable and its value. In the image you can see that I accessed "launch configuration" from the tomcat overview.
Another option is to use GoogleCredentials.fromStream ("path_to_json") to set the credentials, depending on which api is used where it can be used.