When I try to run .bin/elasticsearch, I get the following error:
could not find java in bundled jdk at /home/ubuntu/Elastic Search/elasticsearch-7.8.0/jdk/bin/java
I have absolutely no idea what's going on. I know this topic has been created before, but I haven't found a way to fix. For java -version
I get:
openjdk version "1.8.0_265"
OpenJDK Runtime Environment (build 1.8.0_265-8u265-b01-0ubuntu2~20.04-b01)
OpenJDK 64-Bit Server VM (build 25.265-b01, mixed mode)
Can anyone help me please? Thank you!
According to the Elasticsearch configuration docs, you can edit /etc/default/elasticsearch and set JAVA_HOME there for Elasticsearch.
Note: Elasticsearch requires at least Java version 7, but for Elasticsearch version 1.7. 1 it is recommended that you use Oracle JDK version 1.8. 0_25 or higher on the operating system that deploys the Elasticsearch server. Therefore, set JAVA_HOME accordingly.
The most probable reason for the above error is that
JAVA_HOME
is not set
JAVA_HOME
variable path, run this command echo $JAVA_HOME
If nothing appears then follow the below steps:
sudo update-alternatives --config java
export JAVA_HOME=<YOUR-JAVA-PATH>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With