0

When I use Windows system to set the environment variable program can run normally, change to Linux test, appeared

2022-06-27 12:10:27,814 [pool-6-thread-1] ERROR InfiniteStreamRecognize - 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 credentials. See https://developers.google.com/accounts/docs/application-default-credentials for more information. at com.google.auth.oauth2.DefaultCredentialsProvider.getDefaultCredentials(DefaultCredentialsProvider.java:134) at com.google.auth.oauth2.GoogleCredentials.getApplicationDefault(GoogleCredentials.java:125) at com.google.auth.oauth2.GoogleCredentials.getApplicationDefault(GoogleCredentials.java:97) at com.google.api.gax.core.GoogleCredentialsProvider.getCredentials(GoogleCredentialsProvider.java:70) at com.google.api.gax.rpc.ClientContext.create(ClientContext.java:168) at com.google.cloud.speech.v1p1beta1.stub.GrpcSpeechStub.create(GrpcSpeechStub.java:95) at com.google.cloud.speech.v1p1beta1.stub.SpeechStubSettings.createStub(SpeechStubSettings.java:133) at com.google.cloud.speech.v1p1beta1.SpeechClient.(SpeechClient.java:134) at com.google.cloud.speech.v1p1beta1.SpeechClient.create(SpeechClient.java:116) at com.google.cloud.speech.v1p1beta1.SpeechClient.create(SpeechClient.java:108) at com.duplicall.ibaeonline.EngineClients.google.InfiniteStreamRecognize.infiniteStreamingRecognize(InfiniteStreamRecognize.java:94) at com.duplicall.ibaeonline.EngineClients.google.InfiniteStreamRecognize.lambda$StartTrans$0(InfiniteStreamRecognize.java:290) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748)

does Linux require additional Settings? how can i solved this prolem ?

2 Answers2

0

This environment: this environment

  1. I have set environment in system
  2. echo $GOOGLE_APPLICATION_CREDENTIALS, Path information can be displayed
  3. cat $GOOGLE_APPLICATION_CREDENTIALS, You can see the content information
Jeremy Caney
  • 7,102
  • 69
  • 48
  • 77
0

This problem has been solved, the problem is not the environment variable, it is my program startup script. When I use java -jar to start the program, it works as well as WIN system