user1@ubuntu-trusty-1:~$ sudo -i service elasticsearch start
Could not find any executable java binary. Please install java in your PATH or set JAVA_HOME
user1@ubuntu-trusty-1:~$ su -
Password:
root@ubuntu-trusty-1:~# echo $JAVA_HOME
/opt/jdk-11.0.2
root@ubuntu-trusty-1:~# echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/jdk-11.0.2/bin
root@ubuntu-trusty-1:~# java -version
openjdk version "11.0.2" 2019-01-15
OpenJDK Runtime Environment 18.9 (build 11.0.2+9)
OpenJDK 64-Bit Server VM 18.9 (build 11.0.2+9, mixed mode)
root@ubuntu-trusty-1:~# which java
/opt/jdk-11.0.2/bin/java
I installed Elasticsearch by apt-get, but installed java by tar.
That's the reason why I faced to this issue.
By installing java by apt-get was the way to resolve.
Thank you.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.