Issue
HOW CAN I ACHIEVE THIS?
I am following this google doc.
Currently, my SheetsQuickstart.java
file runs with the following error:
Exception in thread "main" java.lang.NoSuchMethodError: com.google.api.client.http.javanet.NetHttpTransport.<init>(Lcom/google/api/client/http/javanet/ConnectionFactory;Ljavax/net/ssl/SSLSocketFactory;Ljavax/net/ssl/HostnameVerifier;)V
at com.google.api.client.http.javanet.NetHttpTransport$Builder.build(NetHttpTransport.java:317)
at com.google.api.client.googleapis.javanet.GoogleNetHttpTransport.newTrustedTransport(GoogleNetHttpTransport.java:55)
at SheetsQuickstart.main(SheetsQuickstart.java:63)
Where should I keep my credentials.json
file?
Are there any more steps in servlets to overcome this? Any Doc or a simple demo project(or anything related) will help
Solution
My Question basically was:
Where to keep the credentials.json files if you are working with Java struts or servlets?
The mentioned link (Google Doc) describes the config for android (I think).
After experimenting with it, I found that you can keep the credentials.json
in your src
folder itself.
Also, the steps to use GAPI are:
- Create a project in Google Console.
- Config your OAuth Screen.
- Create your OAuth Credentials.
- Download
credentials.json
and place it your src folder. That should be it. Hope it helps somebody.
Answered By - user13182598
Answer Checked By - Cary Denson (JavaFixing Admin)