如何更改android Studio Java版本?

How to change android Studio Java version?

提问人:Baimam Boukar 提问时间:9/20/2023 更新时间:9/20/2023 访问量:142

问:

我想更改android Studio使用的Java版本。

当我运行我的 flutter 应用程序时,它不会去,这里是我得到的输出消息。Flutte Fix [!] Your project's Gradle version is incompatible with the Java version that Flutter is using for Gradle.

这在某种程度上是bizzare,因为我检查了gradle的文档,我的gradle版本与我拥有的java版本兼容7.520.0.0

但似乎我的 Android 工作室正在考虑另一个 Java 版本,即 .(Android Studio Giraffe 2022.3.1 , The latest version as of September 2023)17

这是我运行时的输出java -version

Java(TM) SE Runtime Environment (build 20.0.2+9-78)
Java HotSpot(TM) 64-Bit Server VM (build 20.0.2+9-78, mixed mode, sharing)```

And here is the output of `flutter doctor -v`
```[✓] Flutter (Channel stable, 3.13.4, on macOS 12.6.3 21G419 darwin-x64, locale en-CM)
    • Flutter version 3.13.4 on channel stable at /Users/baimamboukar/development/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 367f9ea16b (7 days ago), 2023-09-12 23:27:53 -0500
    • Engine revision 9064459a8b
    • Dart version 3.1.2
    • DevTools version 2.25.0

[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.1)
    • Android SDK at /Users/baimamboukar/Library/Android/sdk
    • Platform android-33, build-tools 33.0.1
    • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b829.9-10027231)
    • All Android licenses accepted.

[!] Xcode - develop for iOS and macOS (Xcode 13.2.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 13C100
    ✗ Flutter requires Xcode 14 or higher.
      Download the latest version or update via the Mac App Store.
    • CocoaPods version 1.11.3

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2022.3)
    • Android Studio at /Applications/Android Studio.app/Contents
    • 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 17.0.6+0-17.0.6b829.9-10027231)

[✓] VS Code (version 1.82.2)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.72.0

[✓] Connected device (3 available)
    • JKM LX2 (mobile) • 192.168.43.1:5555 • android-arm64  • Android 9 (API 28)
    • macOS (desktop)  • macos             • darwin-x64     • macOS 12.6.3 21G419 darwin-x64
    • Chrome (web)     • chrome            • web-javascript • Google Chrome 116.0.5845.187

[✓] Network resources
    • All expected network resources are available.```
flutter android-studio android-gradle-plugin java-20

评论


答: 暂无答案