Answers for "Error: JAVA_HOME not found in your environment. Please set the JAVA_HOME variable in your environment to match the location of your Java installation."

2

set java home path

export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64

# Add JAVA bin directory to the PATH variable
export PATH=$PATH:$JAVA_HOME/bin
Posted by: Guest on July-22-2020
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 not found in your environment. 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