董路飞
董路飞

Reputation: 21

Unable to find bundled Java version?

In the Windows 11 environment, I used scoop to install flutter. Finally, I found the following problem. I tried all the solutions to similar problems on the Internet, but it didn’t work. It’s still the same error:


$ flutter doctor -v
[✓] Flutter (Channel stable, 3.3.8, on Microsoft Windows [版本 10.0.22000.1219], locale zh-CN)
    • Flutter version 3.3.8 on channel stable at D:\Program_Files\scoop\apps\flutter\current
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 52b3dc25f6 (2 weeks ago), 2022-11-09 12:09:26 +0800
    • Engine revision 857bd6b74c
    • Dart version 2.18.4
    • DevTools version 2.15.0

[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.1)
    • Android SDK at D:\Program_Files\scoop\apps\android-sdk\current
    • Platform android-TiramisuPrivacySandbox, build-tools 33.0.1
    • ANDROID_HOME = D:\Program_Files\scoop\apps\android-sdk\current
    • Java binary at: D:\Program_Files\scoop\apps\openjdk17\current\bin\java
    • Java version OpenJDK Runtime Environment (build 17.0.2+8-86)
    • All Android licenses accepted.

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

[✓] Visual Studio - develop for Windows (Visual Studio Community 2022 17.4.1)
    • Visual Studio at D:\Microsoft Visual Studio\2022\Community
    • Visual Studio Community 2022 version 17.4.33110.190
    • Windows 10 SDK version 10.0.22000.0

[!] Android Studio (version 2022.2)
    • Android Studio at D:\Program_Files\scoop\apps\android-studio-canary\current
    • 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
    ✗ Unable to find bundled Java version.
    • Try updating or re-installing Android Studio.

[✓] IntelliJ IDEA Ultimate Edition (version 2021.2)
    • IntelliJ at D:\Program Files\JetBrains\IntelliJ IDEA 2021.2
    • 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

[✓] Proxy Configuration
    • HTTP_PROXY is set
    • NO_PROXY is 127.0.0.1;localhost;::1
    • NO_PROXY contains localhost
    • NO_PROXY contains ::1
    • NO_PROXY contains 127.0.0.1

[✓] Connected device (2 available)
    • Windows (desktop) • windows • windows-x64    • Microsoft Windows [版本 10.0.22000.1219]
    • Chrome (web)      • chrome  • web-javascript • Google Chrome 107.0.5304.107

[✓] HTTP Host Availability
    • All required HTTP hosts are available

! Doctor found issues in 1 category.

How to solve it in my environment

Upvotes: 2

Views: 4264

Answers (3)

Waruna Kaushalya
Waruna Kaushalya

Reputation: 144

If you are a mac user -

Go to finder and find Android studio:

  1. right click and click show package contents
  2. Create a new folder called jre
  3. copy the contents of the jbr folder and paste them into jre folder reload your terminal and type flutter doctor

This solution is from @roufy235 and I'm a mac user and this worked for me. Thanks a lot @roufy235.

@roufy235's solution - https://github.com/flutter/flutter/issues/118502#issuecomment-1383215722

If you are a Windows user -

  1. GO TO - C:\Program Files\Android\Android Studio
  2. Then copy the content of jbr and paste the content into jre folder
  3. run flutter doctor again and problem solved

This solution is from @1888ael. Thanks a lot @1888ael.

@1888ael's solution - https://github.com/flutter/flutter/issues/118502#issuecomment-1383219790

Upvotes: 3

Arshad Mansoor
Arshad Mansoor

Reputation: 11

go to C:\Program Files\Android\Android Studio\jbr copy all files now go to C:\Program Files\Android\Android Studio\jre and paste thats all

Upvotes: 0

mahendri
mahendri

Reputation: 81

For anyone coming here after updating Android Studio to 2022.1 Eel, here is what works for me

  1. Open Windows Powershell (I open from windows start icon right-click > terminal (admin) enter image description here

  2. Change directory to Android Studio, for example
    cd '..\..\Program Files\Android\Android Studio\'

  3. Create a symbolic link for "jre" with "jbr", type the following
    New-Item -ItemType SymbolicLink -Path .\jre -Target .\jbr

Thanks to timbophillips for this solution

Upvotes: 1

Related Questions