Skip to content

Flutter doctor is happy with just JRE, but builds fail without JDK  #10351

Open

Description

@DanTup

While trying to fix an issue with flutter (Could not reserve enough space for 1572864KB object heap) I uninstalled 32bit java and installed 64bit. I picked the JRE isntead of JDK and flutter doctor was happy; but builds failed claiming I needed the JDK:

JDK error

Installing the JDK fixed the issue. It would be good if flutter doctor could check this.

Activity

  1. ronlobo commented on May 27, 2017

    @ronlobo

    Fully agree! That would be great!

  2. added
    toolAffects the "flutter" command-line tool. See also t: labels.
    t: flutter doctorProblem related to the "flutter doctor" tool
    on May 27, 2017
  3. added this to the milestone on Dec 19, 2018
  4. changed the title [-]Flutter doctor is happy with just JRE, but builds fail without JDK[/-] [+]Flutter doctor is happy with just JRE, but builds fail without JDK [/+] on Jan 13, 2020
  5. added
    P2Important issues not at the top of the work list
    on May 29, 2020
  6. removed this from the milestone on Jun 2, 2020
  7. removed this from the milestone on Jun 2, 2020
  8. removed this from the milestone on Aug 17, 2020
  9. asashour commented on Jun 23, 2021

    @asashour
    Contributor

    Is this still relevant? I am not able to reproduce

    flutter doctor -v
    [√] Flutter (Channel unknown, 2.3.0-17.0.pre.445, on Microsoft Windows [Version 10.0.19042.985], locale en-US)
        • Flutter version 2.3.0-17.0.pre.445 at C:\use\flutter\clone\flutter
        • Upstream repository unknown
        • Framework revision de0a5e086d (5 hours ago), 2021-06-23 04:01:02 -0400
        • Engine revision 40edba381e
        • Dart version 2.14.0 (build 2.14.0-236.0.dev)
    
    [√] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
        • Android SDK at C:\Users\ahmed_ashour\AppData\Local\Android\sdk
        • Platform android-30, build-tools 30.0.3
        • Java binary at: C:\Program Files\Java\jre1.8.0_291\bin\java
        • Java version Java(TM) SE Runtime Environment (build 1.8.0_291-b10)
        • All Android licenses accepted.
    
    [√] Chrome - develop for the web
        • Chrome at C:\Program Files (x86)\Google\Chrome\Application\chrome.exe
    
    [√] Visual Studio - develop for Windows (Visual Studio Community 2019 16.10.2)
        • Visual Studio at C:\Program Files (x86)\Microsoft Visual Studio\2019\Community
        • Visual Studio Community 2019 version 16.10.31410.357
        • Windows 10 SDK version 10.0.19041.0
    
    [!] Android Studio (version 4.2.0)
        • 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
        X Unable to find bundled Java version.
        • Try updating or re-installing Android Studio.
    
    [√] IntelliJ IDEA Community Edition (version 2021.1)
        • IntelliJ at C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2021.1.1
        • 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
    
    [√] IntelliJ IDEA Ultimate Edition (version 2021.2)
        • IntelliJ at C:\Program Files\JetBrains\IntelliJ IDEA 212.4037.9
        • 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
    
    [√] VS Code (version 1.57.1)
        • VS Code at C:\Users\ahmed_ashour\AppData\Local\Programs\Microsoft VS Code
        • Flutter extension can be installed from:
           https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter
    
    [√] Connected device (2 available)
        • Windows (desktop) • windows • windows-x64    • Microsoft Windows [Version 10.0.19042.985]
        • Chrome (web)      • chrome  • web-javascript • Google Chrome 91.0.4472.114
    
    ! Doctor found issues in 1 category.
    
    logs
    C:\use\delme\mytest>flutter clean
    Deleting build...                                                   10ms
    Deleting .dart_tool...                                              24ms
    Deleting .packages...                                                1ms
    Deleting Generated.xcconfig...                                       0ms
    Deleting flutter_export_environment.sh...                            0ms
    
    C:\use\delme\mytest>flutter run
    Running "flutter pub get" in mytest...                             728ms
    Launching lib\main.dart on Chrome in debug mode...
    Waiting for connection from debug service on Chrome...             19.6s
    This app is linked to the debug service: ws://127.0.0.1:56938/wGwiVoRkmjE=/ws
    Debug service listening on ws://127.0.0.1:56938/wGwiVoRkmjE=/ws
    
     Running with sound null safety
    
      To hot restart changes while running, press "r" or "R".
    For a more detailed help message, press "h". To quit, press "q".
    
    An Observatory debugger and profiler on Chrome is available at: http://127.0.0.1:56938/wGwiVoRkmjE=
    The Flutter DevTools debugger and profiler on Chrome is available at:
    http://127.0.0.1:63509?uri=http%3A%2F%2F127.0.0.1%3A56938%2FwGwiVoRkmjE%3D
    
  10. DanTup commented on Jul 7, 2021

    @DanTup
    ContributorAuthor

    @asashour I think the error only occurs when building for Android (I think that's the only target that requires Java).

  11. andrewkolos commented on Apr 12, 2023

    @andrewkolos
    Contributor

    Still reproducible on master (0a140c6) using Azul Zulu JRE 17.40.19.

    A solution might be to check for a javac binary1 instead or in addition to the java binary during the Android toolchain validation (code).

    Footnotes

    1. Any other JDK-specific file would probably work as well. ↩

  12. added
    team-androidOwned by Android platform team
    and removed
    P2Important issues not at the top of the work list
    team-toolOwned by Flutter Tool team
    on Jun 27, 2025
  13. flutter-triage-bot commented on Jun 27, 2025

    @flutter-triage-bot

    The triaged-tool label is irrelevant if there is no team-tool label or fyi-tool label.

  14. added
    P2Important issues not at the top of the work list
    triaged-androidTriaged by Android platform team
    on Jul 1, 2025
  15. added 2 commits that reference this issue on May 13, 2026
  16. added a commit that references this issue on Jun 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work listt: flutter doctorProblem related to the "flutter doctor" toolteam-androidOwned by Android platform teamtoolAffects the "flutter" command-line tool. See also t: labels.triaged-androidTriaged by Android platform team

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions