title: Caused by: java.lang.ClassNotFoundException: Didn't find class "java.awt.Desktop" in Android
body: <p>I am running java code in android for making credentials using oauth 2.0 in android when i run this code I'm getting issue:</p>
  
  <p>This is my issue:</p>
  
  <blockquote>
    <p>Caused by: java.lang.ClassNotFoundException: Didn't find class "java.awt.Desktop" on path: DexPathList[[zip file "/data/app/com.retrofitdemo-1/base.apk"],nativeLibraryDirectories=[/vendor/lib64, /system/lib64]]</p>
  </blockquote>
  
  <p>This is my code:</p>
  
  <pre><code> private static final GoogleClientSecrets googleSecrets = new GoogleClientSecrets();
   googleSecrets.setInstalled(
              new GoogleClientSecrets.Details()
                      .setClientId("542678605378-hlspiumlr34nq04cmjtkft17i6k3hvr0.apps.googleusercontent.com")
                      .setClientSecret("{client_secretid}")
      );
      // Build flow and trigger user authorization request.
      GoogleAuthorizationCodeFlow flow =
              new GoogleAuthorizationCodeFlow.Builder(
                      AndroidHttp.newCompatibleTransport(), JacksonFactory.getDefaultInstance(), googleSecrets, Arrays.asList(SCOPES))
   .setAccessType("offline")
                      .build();
      Credential credential1 = new AuthorizationCodeInstalledApp(
              flow, new LocalServerReceiver()).authorize("user");
      Log.i("AA","credential1--"+credential1);
  
      new MakeRequestTask(credential).execute();
  </code></pre>
  
  <p>How to import awt package in android?</p>