0

I have been trying to install Flutter and everything went smoothly until I launched the debugger and got an error stating, you need java 11 or higher to build your app with this version of gradle.

I went to preferences -> build, execution, deployment -> gradle

but there's no option for updating the path. How do I fix this?

I expected to see Gradle JDK path under Gradle projects, but there is no such option present whatsoever.

Ramji
  • 904
  • 2
  • 5
  • 20
Yusha G.
  • 1
  • 1
  • To fix this issue, you have to installed the latest version of Java on your machine. check the `version` by `java -version` and [download latest version](https://www.java.com/en/download/) and adjust the path in your machine. – gretal Mar 09 '23 at 00:53
  • I have java 15 installed, but gradle isn't able to detect that. So, I think there might be some problem with that. – Yusha G. Mar 10 '23 at 09:42

1 Answers1

0

The JDK pane isn't shown for Flutter apps on the root level. To set the JDK, do the following:

  1. Go to File > Project Structure.
  2. Under Platform Settings, find "SDKs"
  3. Choose Embedded JDK
  4. Locate "JDK home path" and tap the folder icon.
  5. Choose the desired JDK version OR tap "Select JDK home from disk" and locate it in finder, usually in /Library/Java/JavaVirtualMachines/ for MacOS.

More related issue fixing steps at https://stackoverflow.com/a/76172515/840958

Almog C
  • 795
  • 6
  • 14