Skip to content

[flutter doctor] could not determine java version #134333

@zaheermehmood

Description

@zaheermehmood

Is there an existing issue for this?

Steps to reproduce

Flutter doctor is unable to detect the JDK while its already installed. Please note that it happened after I upgraded flutter to latest today. Please note that I can also see the separate jdk path e-g C:\Program Files\Android\jdk\microsoft_dist_openjdk_1.8.0.25.
It seems flutter is picking the bundled path. I also tried to set the JAVA_HOME with both paths i-e

  1. C:\Program Files\Android\jdk\microsoft_dist_openjdk_1.8.0.25
  2. C:\Program Files\Android\Android Studio\jre

Here is the complete trace.

C:\Users\Zaheer>flutter doctor -v
Could not parse java version from:

If there is a version please look for an existing bug https://github.com/flutter/flutter/issues/ and if one does not exist file a new issue.
[√] Flutter (Channel stable, 3.13.3, on Microsoft Windows [Version 10.0.19045.2604], locale en-US)
• Flutter version 3.13.3 on channel stable at C:\Program Files\flutter_windows_1.22.4-stable\flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 2524052 (2 days ago), 2023-09-06 14:32:31 -0700
• Engine revision b8d35810e9
• Dart version 3.1.1
• DevTools version 2.25.0

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

[!] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
• Android SDK at C:\Users\Zaheer\AppData\Local\Android\sdk
• Platform android-34, build-tools 34.0.0
• Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
X Could not determine java version
X Android license status unknown.
Run flutter doctor --android-licenses to accept the SDK licenses.
See https://flutter.dev/docs/get-started/install/windows#android-setup for more details.

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

[!] Visual Studio - develop Windows apps (Visual Studio Community 2019 16.7.6)
• Visual Studio at C:\Program Files (x86)\Microsoft Visual Studio\2019\Community
• Visual Studio Community 2019 version 16.7.30611.23
X Visual Studio is missing necessary components. Please re-run the Visual Studio installer for the "Desktop development with C++" workload, and include these
components:
MSVC v142 - VS 2019 C++ x64/x86 build tools
- If there are multiple build tool versions available, install the latest
C++ CMake tools for Windows
Windows 10 SDK

[√] Android Studio (version 4.1)
• 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 1.8.0_242-release-1644-b01)

[√] VS Code, 64-bit edition (version 1.82.0)
• VS Code at C:\Program Files\Microsoft VS Code
• Flutter extension version 3.72.0

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

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

! Doctor found issues in 2 categories.

Expected results

There should not be any issue because JDK is already installed.

Actual results

Its unable to find the version.

Code sample

Code sample
[Paste your code here]

Screenshots or Video

Screenshots / Video demonstration

[Upload media here]

Logs

Logs
[Paste your logs here]

Flutter Doctor output

Doctor output
C:\Users\Zaheer>flutter doctor -v
Could not parse java version from:

If there is a version please look for an existing bug https://github.com/flutter/flutter/issues/ and if one does not exist file a new issue.
[√] Flutter (Channel stable, 3.13.3, on Microsoft Windows [Version 10.0.19045.2604], locale en-US)
    • Flutter version 3.13.3 on channel stable at C:\Program Files\flutter_windows_1.22.4-stable\flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 2524052335 (2 days ago), 2023-09-06 14:32:31 -0700
    • Engine revision b8d35810e9
    • Dart version 3.1.1
    • DevTools version 2.25.0

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

[!] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    • Android SDK at C:\Users\Zaheer\AppData\Local\Android\sdk
    • Platform android-34, build-tools 34.0.0
    • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
    X Could not determine java version
    X Android license status unknown.
      Run `flutter doctor --android-licenses` to accept the SDK licenses.
      See https://flutter.dev/docs/get-started/install/windows#android-setup for more details.

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

[!] Visual Studio - develop Windows apps (Visual Studio Community 2019 16.7.6)
    • Visual Studio at C:\Program Files (x86)\Microsoft Visual Studio\2019\Community
    • Visual Studio Community 2019 version 16.7.30611.23
    X Visual Studio is missing necessary components. Please re-run the Visual Studio installer for the "Desktop development with C++" workload, and include these
      components:
        MSVC v142 - VS 2019 C++ x64/x86 build tools
         - If there are multiple build tool versions available, install the latest
        C++ CMake tools for Windows
        Windows 10 SDK

[√] Android Studio (version 4.1)
    • 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 1.8.0_242-release-1644-b01)

[√] VS Code, 64-bit edition (version 1.82.0)
    • VS Code at C:\Program Files\Microsoft VS Code
    • Flutter extension version 3.72.0

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

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

! Doctor found issues in 2 categories.

C:\Users\Zaheer>

Metadata

Metadata

Assignees

No one assigned

    Labels

    r: solvedIssue is closed as solved

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions