my flutter doctor can not recognize JAVA_HOME path
I set JAVA_HOME path in environment variable: C:\Program Files\Java\jdk-23
My flutter doctor -v
:
[✓] Flutter (Channel stable, 3.24.3, on Microsoft Windows [Version 10.0.22621.4317], locale en-US)
• Flutter version 3.24.3 on channel stable at C:\Users\Admin\dev\flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 2663184aa7 (7 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 34.0.0)
• Android SDK at C:\Users\Admin\AppData\Local\Android\sdk
• Platform android-34, build-tools 34.0.0
• Java binary at: /Library/Java/JavaVirtualMachines/jdk-17.jdk/Contents/Home\bin\java
✗ Cannot execute /Library/Java/JavaVirtualMachines/jdk-17.jdk/Contents/Home\bin\java to determine the version
[✓] Chrome - develop for the web
• Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe
[✗] Visual Studio - develop Windows apps
✗ Visual Studio not installed; this is necessary to develop Windows apps.
Download at https://visualstudio.microsoft.com/downloads/.
Please install the "Desktop development with C++" workload, including all of its default components
[✓] Android Studio (version 2024.2)
• 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 21.0.3+-12282718-b509.11)
[✓] Connected device (3 available)
• Windows (desktop) • windows • windows-x64 • Microsoft Windows [Version 10.0.22621.4317]
• Chrome (web) • chrome • web-javascript • Google Chrome 130.0.6723.71
• Edge (web) • edge • web-javascript • Microsoft Edge 130.0.2849.56
[✓] Network resources
• All expected network resources are available.
! Doctor found issues in 2 categories.
I use windows and it does not have this path (/Library/Java/JavaVirtualMachines/...).
I changed my jdk versions and also nothing
I`m not sure, you can try changing to bin path of your java sdk in JAVA_HOME like "C:\Program Files\Java\jdk-23\bin"
OR
Set path "C:\Program Files\Android\Android Studio\jbr" in JAVA_HOME in user variable.Then restart your system and try.