Flutter doctor JAVA SDK版本还是老的

问题描述 投票:0回答:1

下面提到了Java路径和我收到的错误。并且我正确设置了JAVA_HOME sdk版本。也许 flutter sdk 旧了?

1.

C:\Users\ASUS>flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, 3.24.3, on Microsoft Windows [Version 10.0.19045.4894], locale tr-TR)
[√] Windows Version (Installed version of Windows is version 10 or higher)
[!] Android toolchain - develop for Android devices (Android SDK version 35.0.0)
    X Android license status unknown.
      Run `flutter doctor --android-licenses` to accept the SDK licenses.
      See https://flutter.dev/to/windows-android-setup for more details.
[√] Chrome - develop for the web
[√] Visual Studio - develop Windows apps (Visual Studio Community 2022 17.4.3)
[√] Android Studio (version 2021.3)
[√] VS Code (version 1.94.0)
[√] Connected device (3 available)
[√] Network resources

! Doctor found issues in 1 category.
C:\Users\ASUS>flutter doctor --android-licenses
Java version 17 or higher is required.
To override this check set SKIP_JDK_VERSION_CHECK
C:\Users\ASUS>java -version
java version "19" 2022-09-20
Java(TM) SE Runtime Environment (build 19+36-2238)
Java HotSpot(TM) 64-Bit Server VM (build 19+36-2238, mixed mode, sharing)
C:\Users\ASUS>where java
C:\Program Files\Java\jdk-19\bin\java.exe
  1. android studio sdk设置
java flutter sdk
1个回答
0
投票

Flutter 似乎无法正确识别您的 Java 版本。您应该尝试以下一些步骤来解决该问题:

  1. 检查
    JAVA_HOME
    :确保它指向JDK 19安装目录。
  2. 更新
    Path
    变量
    :确保
    C:\Program Files\Java\jdk-19\bin
    已正确添加到您的
    Path
    环境变量中。
  3. 重新运行 Flutter Doctor:进行更改后,重新启动命令提示符并运行:
    flutter doctor
    
  4. 接受 SDK 许可证:如果出现提示,请运行:
    flutter doctor --android-licenses
    
© www.soinside.com 2019 - 2024. All rights reserved.