How to fix 'To use the 'java' command-line tool you need to install a JDK' error
1 min read

How to fix 'To use the 'java' command-line tool you need to install a JDK' error

You do not need to install the official Oracle JDK.

You can solve the error "To use the “java” command-line tool you need to install a JDK. Click “More Info…” to visit the Java Developer Kit download website." on macOS, by installing a version of the JDK.

You do not need to install the official Oracle ones, you can install the AdoptOpenJDK ones by running

brew cask install adoptopenjdk

This will save you a preference panel in System Preference, and you can manage the installation with brew cask.

Wanna stay up-to-date with Flutter and Dart?

Subscribe to get a weekly email with the best articles about Flutter and Dart.

    We won't send you spam. Unsubscribe at any time.