ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH
Windows 10:
Android Studio -> File -> Other Settings -> Default Project Structure... -> JDK location:
copy string shown, such as:
C:Program FilesAndroidAndroid Studiojre
In file locator directory window, right-click on "This PC" ->
Properties -> Advanced System Settings -> Environment Variables... -> System Variables
click on the New... button under System Variables, then type and paste respectively:
.......Variable name: JAVA_HOME
.......Variable value: C:Program FilesAndroidAndroid Studiojre
and hit OK buttons to close out.