Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Gmail API import AuthorizationCodeInstalledApp and LocalServerReceiver Clases

Tags:

java

gmail-api

I am trying to create a java file which will send an email. I created a Google web application projects, configured it (hoping I did it properly) and then followed the Java Quickstart guide.

Though I can't import these classes (guessing that therefore also can't run the file):

com.google.api.client.extensions.java6.auth.oauth2.AuthorizationCodeInstalledApp
import com.google.api.client.extensions.jetty.auth.oauth2.LocalServerReceiver

How can I fix this?

like image 556
Nir.L Avatar asked Mar 04 '26 16:03

Nir.L


1 Answers

If you are using Maven, then add these two dependency.

<dependency>
    <groupId>com.google.oauth-client</groupId>
    <artifactId>google-oauth-client-java6</artifactId>
    <version>1.11.0-beta</version>
</dependency>
<dependency>
    <groupId>com.google.oauth-client</groupId>
    <artifactId>google-oauth-client-jetty</artifactId>
    <version>1.23.0</version>
</dependency>
like image 64
SPS Avatar answered Mar 07 '26 06:03

SPS



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!