Issue
How do i solve this ? I've downloaded Android Studio Preview on my M1 Mac as suggested
error after running flutter doctor
The operation couldn’t be completed. Unable to locate a Java Runtime.
Please visit http://www.java.com for information on installing Java.
[✓] Flutter (Channel beta, 2.3.0-24.1.pre, on macOS 11.4 20F71 darwin-arm,
locale fr-FR)
[✗] Android toolchain - develop for Android devices
✗ cmdline-tools component is missing
Run `path/to/sdkmanager --install "cmdline-tools;latest"`
See https://developer.android.com/studio/command-line for more details.
[✓] Xcode - develop for iOS and macOS
[✓] Chrome - develop for the web
[!] Android Studio
✗ Unable to find bundled Java version.
[✓] VS Code (version 1.58.2)
[✓] Connected device (2 available)
why is it still not working ?
Solution
I've been using SDK Man for years to install, update and change java versions with simple commands. It will take care of the installation and environment variable setup as well.
Here is a simple guide for mac users
Once the sdkman is installed, you can use it from the commandline:
sdk ls java
It will return a table with all the available versions.
The cleanest choice is the lastest 'official' LTS version, where the vendor is Java.net
and the current latest version is 11.0.11-open
Sdkman also helps you with a command sample at the bottom of the table, so for the current latest LTS openJDK, I would go with:
sdk install java 11.0.11-open
And that's all. Or if you have previously installed java versions (installed through other means) it is best to remove them.
Answered By - Péter Veres
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.