Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
rshad opened this issue Aug 14, 2019 · 3 comments · Fixed by #45593
Assignees
Labels
>bug :Delivery/Packaging RPM and deb packaging, tar and zip archives, shell and batch scripts Team:Delivery Meta label for Delivery team

Comments

@rshad
Copy link

rshad commented Aug 14, 2019

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

@jasontedor
Copy link
Member

I read the source and I concur that there is a bug here. I will reproduce and I will open a fix soon. Thanks for reporting.

@jasontedor jasontedor added the :Delivery/Packaging RPM and deb packaging, tar and zip archives, shell and batch scripts label Aug 14, 2019
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-core-infra

@rshad
Copy link
Author

rshad commented Aug 15, 2019

Hi @jasontedor!

Thanks for the quick response!

I'll re-install it to check the new fixes effects.

Kind regards,

Rshad

@mark-vieira mark-vieira added the Team:Delivery Meta label for Delivery team label Nov 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>bug :Delivery/Packaging RPM and deb packaging, tar and zip archives, shell and batch scripts Team:Delivery Meta label for Delivery team
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants