Skip to content

Elasticsearch 7.2.* is not detecting its own JVM java binary on CentOS 6.* or Ubuntu Trusty 14.04 #45542

@rshad

Description

@rshad

Elasticsearch version:

7.2.0

JVM version:

The issue is related to Java. No Java is previously installed.

OS version:

CentOS 6.* or Ubuntu Trusty 14.04

Description of the problem including expected versus actual behavior:

Elasticsearch 7.2.* is not detecting its own JVM when starting the service.

Steps to reproduce:

Once Elasticsearch is installed, then when trying to start it:

service elasticsearch start

Elasticsearch 7.2.* is not detecting its own JVM when starting the service, implying to get an error message:

which: no java in (/sbin:/usr/sbin:/bin:/usr/bin)
Could not find any executable java binary. Please install java in your PATH or set JAVA_HOME

Solution

As Elasticsearch says in the official documentation, there is no need to have JVM installed in the machine where running Elasticsearch because it has an already installed JVM in Elasticsearch home folder. In this case the home folder is

/usr/share/elasticsearch/jdk/

We have to create a symbolic link to Java binary as follows:

ln -s /usr/share/elasticsearch/jdk/bin/java /usr/bin/java 

Then we can detect the changes by checking Java version:

java --version
openjdk 12.0.1 2019-04-16
OpenJDK Runtime Environment (build 12.0.1+12)
OpenJDK 64-Bit Server VM (build 12.0.1+12, mixed mode, sharing)

Provide logs (if relevant):
Not Needed in this case.

Referecnes

Official Docs: https://www.elastic.co/guide/en/elasticsearch/reference/current/setup.html

Metadata

Metadata

Assignees

Labels

:Delivery/PackagingRPM and deb packaging, tar and zip archives, shell and batch scripts>bugTeam:DeliveryMeta label for Delivery team

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions