admin管理员组文章数量:1124801
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
1 Answer
Reset to default 0try updating JAVA_HOME variable
- Open windows search and write Environment Variables
- Click on Edit the system environment variables
- Click the Environment Variables button on bottom
- Under System Variables or User variables search for JAVA_HOME.
- if exists update it with your JDK absolute path (just open the folder and click on top to get absolute path)
- if doesn't exists create a new variable and call it JAVA_HOME and then just enter your JDK absolute path in variable value
- click OK and apply changes
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
本文标签: javaFlutter somehow thinks I39m on macOS even though I39m on WindowsStack Overflow
版权声明:本文标题:java - Flutter somehow thinks I'm on macOS even though I'm on Windows - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736619330a1945539.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
JAVA_HOME
come from? What is its value? – Tim Roberts Commented yesterday/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 yesterday