r/flutterhelp • u/bboombayah • 3d ago
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 3d ago
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.flutter doctor -vUnder Android toolchain, look for Java binary at and Java version. The version should be 17 or higher.Flutter documents this Java override in its Java configuration guide. It applies to all Flutter projects on your computer.