title: How to upgrade an Android project to Java 11
body: <p>I am using the latest Android Studio Arctic Fox 2020.03.01 Canary 8 and AGP 7, and I want to convert my project to use Java 11. Apparently just doing the following does not work as mentioned on <a href="https://developer.android.com/studio/preview/features#use-java-11" rel="noreferrer">https://developer.android.com/studio/preview/features#use-java-11</a>:</p>
  <pre><code>android {
      compileSdkVersion 30
  
      compileOptions {
        sourceCompatibility JavaVersion.VERSION_11
        targetCompatibility JavaVersion.VERSION_11
      }
  
      // For Kotlin projects
      kotlinOptions {
        jvmTarget = &quot;11&quot;
      }
  }
  </code></pre>
  <p>I get the following error when I build:</p>
  <pre><code>Execution failed for task ':app:compileDebugJavaWithJavac'.
  &gt; Could not resolve all files for configuration ':app:androidJdkImage'.
     &gt; Failed to transform core-for-system-modules.jar to match attributes {artifactType=_internal_android_jdk_image, org.gradle.libraryelements=jar, org.gradle.usage=java-runtime}.
        &gt; Execution failed for JdkImageTransform: /Users/azfarsiddiqui/Library/Android/sdk/platforms/android-30/core-for-system-modules.jar.
           &gt; jlink executable /Applications/Android Studio Preview.app/Contents/jre/jdk/Contents/Home/bin/jlink does not exist.
  
  * Try:
  Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
  </code></pre>
  <p>To keep it simple, I've been trying this on a Jetpack Compose sample project here: <a href="https://github.com/android/compose-samples/tree/main/JetNews" rel="noreferrer">https://github.com/android/compose-samples/tree/main/JetNews</a></p>
  <p>Any thoughts? Thanks guys</p>