JAVA not in path although JAVA_HOME set
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/javasudo apt-get updatesudo apt-get install oracle-java8-installerjava -version
Then upon running sudo service elasticsearch start
everything worked and I had no more Java path issues.
run the command
java -XshowSettings
search the entry java.home = /usr/java/jdk1.8.0_91/jre
export the java_home in your bash profile
export JAVA_HOME=/usr/java/jdk1.8.0_91/jre
or in /etc/profile
to expand to all users
Specifically for OpenBSD6.0, add
export JAVA_HOME=/usr/local/jdk-1.8.0/
to your .profile
.
This specific version of the jdk, and possibly the basic path itself is subject to change in subsequent and previous versions of OpenBSD, you have been warned.