Set the JDK Directory in Flutter: Open your terminal or command prompt. Run the following command, replacing with the path to your JDK installation: flutter config --jdk-dir= Example: flutter config --jdk-dir="/Library/Java/JavaVirtualMachines/jdk-11.0.12/Contents/Home"