I am on Mac.
Output of echo $JAVA_HOME
:
/Library/Java/JavaVirtualMachines/jdk-16.0.2.jdk/Contents/Home
Output of Visual Studio when I try to build my Flutter app for Android:
Launching lib/main.dart on sdk gphone x86 arm in debug mode...
lib/main.dart:1
ERROR: JAVA_HOME is set to an invalid directory: /Library/Java/JavaVirtualMachines/jdk-16.0.2.jdk/Contents/Home/bin/
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation.
Exception: Gradle task assembleDebug failed with exit code 1
Exited (sigterm)