ERROR: JAVA_HOME is not set and no 'java' command could be found in your flutter PATH. In Flutter

asked5 years ago
last updated3 years ago
viewed149.7k times
Up Vote66Down Vote

I installed Android Studio 4.1 and tried to run the existing project. But it gives an error like this:

ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.

Please set the JAVA_HOME variable in your environment to match the
location of your Java installation.