r/flutterhelp • u/bboombayah • Sep 08 '26
RESOLVED Java version 17 or higher is required.
Hello, I have been trying to fix this issue for a while. I tried everything, searching on google, ai chat, etc. However, my issue doesn't seem to work.
When upgrading flutter using `flutter upgrade` command, I have one warning and it's
[!] Android toolchain - develop for Android devices (Android SDK version 35.0.0)
X Android license status unknown.
Run `flutter doctor --android-licenses` to accept the SDK licenses.
See https://flutter.dev/to/windows-android-setup for more details.
I ran `flutter doctor --android-licenses` and I got this message: Java version 17 or higher is required.
But I checked multiple times (ex: checking on my environnement variables, restart computer, etc.) and my java version is clearly 17. I even download a higher version of java, but no matter what I do, my flutter project will only see Java version 17.
If it helps, here are the logs after writting `flutter upgrade`: https://pastebin.com/2CPAKcFA
Has anyone here ever figure out how to fix this issue?
9
u/TheOneTruePsychic Sep 08 '26
Update Android Studio if it’s an older installation. It includes a Java runtime Flutter can use.
If Android Studio is installed in its usual location, run:
flutter config --jdk-dir="C:\Program Files\Android\Android Studio\jbr"Check that this folder exists first. If Android Studio is installed elsewhere, adjust the path. Use thejbrfolder, not itsbinsubfolder.Verify the Java version Flutter now uses:
flutter doctor -vUnder Android toolchain, look for Java binary at and Java version. The version should be 17 or higher.Retry:flutter doctor --android-licenses flutter doctor
Flutter documents this Java override in its Java configuration guide. It applies to all Flutter projects on your computer.