I'm using Android studio on my windows and running flutter doctor responds with
flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, 3.27.1, on Microsoft Windows [Version 10.0.26100.2605], locale en-GB)
[√] Windows Version (Installed version of Windows is version 10 or higher)
[!] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
X Cannot execute /Library/Java/JavaVirtualMachines/jdk-21.jdk/Contents/Home\bin\java to determine the version
[√] Chrome - develop for the web
[√] Visual Studio - develop Windows apps (Visual Studio Community 2022 17.7.4)
[√] Android Studio (version 2024.2)
[√] VS Code (version 1.92.2)
[√] Connected device (3 available)
[√] Network resources
! Doctor found issues in 1 category.
gpt says This error occurs because the system is looking for Java in a macOS path while you're on Windows.
Updating PATH variable to include: %JAVA_HOME%\bin
didn't work
I'm using Android studio on my windows and running flutter doctor responds with
flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, 3.27.1, on Microsoft Windows [Version 10.0.26100.2605], locale en-GB)
[√] Windows Version (Installed version of Windows is version 10 or higher)
[!] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
X Cannot execute /Library/Java/JavaVirtualMachines/jdk-21.jdk/Contents/Home\bin\java to determine the version
[√] Chrome - develop for the web
[√] Visual Studio - develop Windows apps (Visual Studio Community 2022 17.7.4)
[√] Android Studio (version 2024.2)
[√] VS Code (version 1.92.2)
[√] Connected device (3 available)
[√] Network resources
! Doctor found issues in 1 category.
gpt says This error occurs because the system is looking for Java in a macOS path while you're on Windows.
Updating PATH variable to include: %JAVA_HOME%\bin
didn't work
try updating JAVA_HOME variable
or you can just enter a command
setx /m JAVA_HOME [your JDK absolute path]
here a example on how to get you jdk absolute path screenshot
JAVA_HOME
come from? What is its value? – Tim Roberts Commented Jan 9 at 18:31/Library/Java/JavaVirtualMachines/jdk-21.jdk/Contents/Home\bin\java
. It seems like your current path is a mix of/
and \. Try updating it in a way that use only one of these. – Reza Farjam Commented Jan 9 at 18:46