Answers for "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."

0

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.
Posted by: Guest on December-21-2021
0

could not find java; set JAVA_HOME or ensure java is in PATH

After reading the docs from ElasticSearch,
I found that if you're running on Ubuntu or Debian,
the package only ships with the OpenJDK because of licensing issues.
To fix this Java path problem, I installed the following
after installing ElasticSearch (as directed by the docs):

	sudo add-apt-repository ppa:webupd8team/java
	sudo apt-get update
	sudo apt-get install oracle-java8-installer
	java -version
Then upon running
sudo service elasticsearch start
everything worked and I had no more Java path issues.
Posted by: Guest on September-11-2020

Code answers related to "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."

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language