JAVA not in path although JAVA_HOME set

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.


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.


To get it going - though not nice - you could setup a symbolic link to your java in /usr/bin (which is listed by elasticsearch to be seen):

ln -s /root/Applications/jdk1.7.0_79/bin/java /usr/bin/java