javafluttersdk

Flutter doctor JAVA SDK version still old


The Java path and the error I received are mentioned below. and i set JAVA_HOME correctly sdk version. Maybe flutter sdk old ? thank you.

flutter doctor, where java, andorid -lisences, java -version

1.

[√] Flutter (Channel stable, 3.24.3, on Microsoft Windows [Version 10.0.19045.4894], locale tr-TR)
    • Flutter version 3.24.3 on channel stable at C:\src\flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 2663184aa7 (4 weeks ago), 2024-09-11 16:27:48 -0500
    • Engine revision 36335019a8
    • Dart version 3.5.3
    • DevTools version 2.37.3

[√] Windows Version (Installed version of Windows is version 10 or higher)

[!] Android toolchain - develop for Android devices (Android SDK version 35.0.0)
    • Android SDK at C:\Users\ASUS\AppData\Local\Android\sdk
    • Platform android-35, build-tools 35.0.0
    • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
    • Java version OpenJDK Runtime Environment (build 11.0.13+0-b1751.21-8125866)
    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.

[√] Chrome - develop for the web
    • Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe

[√] Visual Studio - develop Windows apps (Visual Studio Community 2022 17.4.3)
    • Visual Studio at C:\Program Files\Microsoft Visual Studio\2022\Community
    • Visual Studio Community 2022 version 17.4.33205.214
    • Windows 10 SDK version 10.0.22000.0

[√] Android Studio (version 2021.3)
    • Android Studio at C:\Program Files\Android\Android Studio
    • Flutter plugin can be installed from:
       https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
       https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 11.0.13+0-b1751.21-8125866)

[√] VS Code (version 1.94.0)
    • VS Code at C:\Users\ASUS\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension version 3.97.20240902

[√] Connected device (3 available)
    • Windows (desktop) • windows • windows-x64    • Microsoft Windows [Version 10.0.19045.4894]
    • Chrome (web)      • chrome  • web-javascript • Google Chrome 129.0.6668.90
    • Edge (web)        • edge    • web-javascript • Microsoft Edge 129.0.2792.79

[√] Network resources
    • All expected network resources are available.

! Doctor found issues in 1 category.
C:\Users\ASUS>flutter doctor --android-licenses
Java version 17 or higher is required.
To override this check set SKIP_JDK_VERSION_CHECK
C:\Users\ASUS>java -version
java version "19" 2022-09-20
Java(TM) SE Runtime Environment (build 19+36-2238)
Java HotSpot(TM) 64-Bit Server VM (build 19+36-2238, mixed mode, sharing)
C:\Users\ASUS>where java
C:\Program Files\Java\jdk-19\bin\java.exe
  1. android studio sdk settings

  2. environment variables


Solution

  • It doesn't matter which version of Java you've installed or where your JAVA_HOME or PATH variables are pointing; Flutter will just use the JDK included in Android Studio. Your output shows that your installed version of Android Studio includes Java 11:

    [√] Android Studio (version 2021.3)
        • Android Studio at C:\Program Files\Android\Android Studio
        • Flutter plugin can be installed from:
           https://plugins.jetbrains.com/plugin/9212-flutter
        • Dart plugin can be installed from:
           https://plugins.jetbrains.com/plugin/6351-dart
        • Java version OpenJDK Runtime Environment (build 11.0.13+0-b1751.21-8125866)
    

    Upgrade your Android Studio to a more recent version: specifically, one that uses Java 17. Preferably the latest one.