How to fix error: Android Gradle plugin requires Java 11 to run. You are currently using Java 1.8.

Опубликовано: 18 Март 2026
на канале: Awesome Dev Notes
35,551
292

"The reference in the build.gradle file is about the version you target to compile your code. This should stay on 1.8.

What changed is the JDK used to run Gradle. By default, this is the version embedded in Studio (when running builds from inside the IDE, for command-line builds, this is whatever you have set up in your terminal). 4.2 embeds (and runs on) JDK11 already even if AGP 4.2 can run on JDK8."

From the discussion on androiddev reddit: https://www.reddit.com/r/androiddev/c...

References:

JDK 11 downloads: https://www.oracle.com/hk/java/techno...

JDK 11 Direct Download Link for windows 64: https://download.oracle.com/otn/java/...

Studio 2020.3.1 embeds JDK11 and the matching AGP 7.0.0 requires 11 too.

📚 Learn Android from Experts at:
https://github.com/androiddevnotes/aw...

😎 Find more Awesome Android Apps in Kotlin, MVVM, Jetpack:
https://github.com/androiddevnotes/aw...

📱 Follow us on:

⭐ Discord:
  / discord  

⭐ GitHub:
https://github.com/androiddevnotes

⭐ Twitter:
  / androiddevnotes  

⭐ Instagram:
  / androiddevnotes  

⭐ Medium:
  / androiddevnotes