Skip to main content
Stack Overflow
  1. About
  2. For Teams

Timeline for Android Studio Error "Android Gradle plugin requires Java 11 to run. You are currently using Java 1.8"

Current License: CC BY-SA 4.0

61 events
when toggle format what by license comment
Aug 4, 2023 at 23:52 review Suggested edits
Aug 9, 2023 at 5:59
May 10, 2023 at 12:28 comment added Swaminath Bera Even after setting this, I'd to restart the laptop because gradlew --version was still returning old cache version 1.8. So please restart if setting correct version still doesn't work
Apr 10, 2023 at 5:37 comment added cmgchess had to cd android and gradlew --version in windows
Nov 4, 2022 at 16:40 comment added j1nma sdk use java 11 fixed it, despite having Java 11 everywhere in Android Studio
Aug 21, 2022 at 13:10 comment added Arun Aditya works for me @sampath answer is also working
Aug 17, 2022 at 16:51 history edited Peter Mortensen CC BY-SA 4.0
Fixed the weird syntax highlighting (as a result, the diff looks more extensive than it really is - use view "Side-by-side Markdown" to compare).
Jul 4, 2022 at 6:34 comment added beginners In my case, changing java version in gradle didn't work. I didn't have java 11 in my windows. i installed jdk 11 and insert jdk path to windows config path and it works
Jun 14, 2022 at 9:41 comment added Pecana This saved me! I had non specific configuration for debug so I didn't know which store was used :-)
Apr 4, 2022 at 12:04 comment added vainu i tried all the things but still getting this "Android Gradle plugin requires Java 11 to run. You are currently using Java 1.8" error in cmd. any one can help me to solve this problem
Mar 31, 2022 at 8:28 comment added JohnyTex You can set gradlew JDK in gradle.properties with property: org.gradle.java.home=<JDK dir>
Mar 31, 2022 at 8:23 comment added JohnyTex Gradle JVM selection process: jetbrains.com/help/idea/…
Mar 25, 2022 at 9:23 comment added Salim Mazari Boufares This solution is not permanent, for each new project we have to do it again, it must a permanent solution.
Mar 13, 2022 at 2:34 history bounty awarded Ven Shine
Jan 13, 2022 at 15:14 comment added Tigran Sarkisian Worked only after updated system (OS) java to 11
Jan 7, 2022 at 6:34 comment added Orange In my case, ./gradelw --version shows the JVM is 15.0.1, but Preferences → Build, Execution, Deployment → Build Tools → Gradle → *Gradle JDK shows 1.8. So they are seems irrelevant. And I changed it to 11 and it works. Thanks!
Dec 20, 2021 at 23:23 comment added ykonda I'm using Android Studio 4 on MacOS. I had to do the Project Structure... section of this answer, and I already had Java 14 so I added Java 14 (Previously only had Java 1.8). Then I did what Pavel Shorokhov wrote and set org.gradle.java.home to the Java 14 location
Nov 19, 2021 at 17:26 comment added Aliaksei Rak if this setting (Preferences → Build, Execution, Deployment → Build Tools → Gradle → *Gradle JDK.) doesn't work. Try to choose in this dropdown "Download JDK..." and choose Amazon version. It helps me.
Nov 15, 2021 at 18:59 history edited Peter Mortensen CC BY-SA 4.0
Active reading [<https://en.wikipedia.org/wiki/Gradle> <https://www.youtube.com/watch?v=1Dax90QyXgI&t=17m54s>]. Used more standard formatting.
Nov 4, 2021 at 19:26 comment added Luke Pighetti I also cannot see the Build Tools in the path shown here
Oct 28, 2021 at 14:56 comment added voghDev Really useful. I also had to clear JAVA_HOME directories I had specified in these locations: .bash_profile, .profile and .bashrc files (Ubuntu 18.04). Now Java 11 is working fine for me, either in Gradle and the Terminal
Oct 22, 2021 at 18:41 comment added jj. I put myself into a world of hate by trying to download a JDK (via Android Studio). Make sure to stay away from JDK17. At least for now. I'd download either 11 or 16 - which gradle supports.
Sep 30, 2021 at 6:41 comment added Nisim Naim Thanks a lot! The last part of your answer did the trick for me, i wasn't aware of that.
Sep 21, 2021 at 8:47 comment added Volodymyr Buberenko @ismailshah You need to put it into build.gradle file of your project. But, I believe it won't help. Make sure that your system (OS) has Java 11, since just changing Gradle settings didn't help me. On MacOS I used sdkman to install and use jdk 11. After installing I saw in ./gradlew -verion proper value for user Java and project started building fine again.
Sep 21, 2021 at 8:44 comment added Volodymyr Buberenko @Zenko This is because changing settings in Gradle section changes version only for current project, while your JAVA_HOME in OS is still an 1.8.
Aug 27, 2021 at 15:28 comment added Ismail Shah where to put this sourceCompatibility and targetCompatibility
Aug 18, 2021 at 3:53 comment added Ahsan Ullah Rasel Changing Gradle JDK to 11, Clean Project, Rebuild Project worked for me! Please also check whether your jvmTarget, sourceCompatibility and targetCompatibility is set to java 11 compileOptions { sourceCompatibility JavaVersion.VERSION_11 targetCompatibility JavaVersion.VERSION_11 } kotlinOptions { jvmTarget = '11' }
Aug 17, 2021 at 7:15 comment added Zenko It is strange that the settings in Build Tools => Gradle have been set to 11 but when I do flutter doctor -v it shows 1.8
S Aug 5, 2021 at 13:27 history suggested lpizzinidev CC BY-SA 4.0
Added Preferences information in setting's path
Aug 4, 2021 at 8:44 review Suggested edits
S Aug 5, 2021 at 13:27
Jul 31, 2021 at 19:25 comment added showtime I cant even find Build Tools in the path you are showing!
May 5, 2021 at 13:27 audit First posts
May 5, 2021 at 13:28
May 5, 2021 at 8:52 audit First posts
May 5, 2021 at 9:18
May 4, 2021 at 13:15 audit First posts
May 4, 2021 at 13:35
May 3, 2021 at 19:02 audit First posts
May 3, 2021 at 19:20
Apr 30, 2021 at 10:27 comment added mochadwi m1 still fails to build :(
Apr 28, 2021 at 20:55 audit First posts
Apr 28, 2021 at 20:56
Apr 28, 2021 at 19:57 audit First posts
Apr 28, 2021 at 19:57
Apr 27, 2021 at 15:33 audit First posts
Apr 27, 2021 at 15:34
Apr 24, 2021 at 0:19 audit First posts
Apr 24, 2021 at 0:20
Apr 23, 2021 at 19:56 audit First posts
Apr 23, 2021 at 20:44
Apr 23, 2021 at 2:49 audit First posts
Apr 23, 2021 at 2:49
Apr 22, 2021 at 8:44 audit First posts
Apr 22, 2021 at 8:56
Apr 20, 2021 at 0:17 audit First posts
Apr 20, 2021 at 0:18
Apr 19, 2021 at 14:25 audit First posts
Apr 19, 2021 at 15:43
Apr 19, 2021 at 2:17 audit First posts
Apr 19, 2021 at 2:17
Apr 18, 2021 at 14:42 audit First posts
Apr 18, 2021 at 14:53
Apr 18, 2021 at 7:05 audit First posts
Apr 18, 2021 at 7:05
Apr 18, 2021 at 1:26 audit First posts
Apr 18, 2021 at 1:27
Apr 17, 2021 at 9:06 audit First posts
Apr 17, 2021 at 9:33
Apr 16, 2021 at 23:35 audit First posts
Apr 16, 2021 at 23:35
Apr 16, 2021 at 21:19 audit First posts
Apr 16, 2021 at 21:19
Apr 16, 2021 at 5:12 audit First posts
Apr 16, 2021 at 5:13
Apr 14, 2021 at 20:50 audit First posts
Apr 14, 2021 at 21:01
Apr 10, 2021 at 11:43 vote accept Ven Shine
Apr 10, 2021 at 11:43 comment added Ven Shine Thanks, I reboot Android Studio, clear cache, then it works.
Apr 9, 2021 at 10:36 history edited M Tomczynski CC BY-SA 4.0
added 612 characters in body
Apr 9, 2021 at 10:23 comment added M Tomczynski you can confirm that Gradle is using the correct version by calling ./gradlew --version in your project directory. It'll output the JVM version
Apr 9, 2021 at 10:18 comment added M Tomczynski @VenShine you could also try switching to system gradle instead of the one from project wrapper. Here's some instructions on the example setup using sdkman blog.jkl.gg/android-studio-slow-as-fxxx
Apr 9, 2021 at 10:16 comment added M Tomczynski I had exact same error and changing the JDK in settings fixed it for me, sorry it's not the case for you. The only difference might be the Gradle as I'm using 7.0 rc2, but that shouldn't matter.
Apr 9, 2021 at 6:26 comment added Ven Shine I have already set it up like this, but it doesn't work.
Apr 8, 2021 at 10:38 history answered M Tomczynski CC BY-SA 4.0
toggle format

AltStyle によって変換されたページ (->オリジナル) /