Skip to content

Don't set JAVA_HOME starting with ES 8.0 #1191

@dliappis

Description

@dliappis

Starting with Elasticsearch 8.0 (elastic/elasticsearch#69149) JAVA_HOME doesn't get honored. One should rely on ES_JAVA_HOME instead. This will also be supported starting with 7.12.0 having higher priority over JAVA_HOME and using JAVA_HOME will be deprecated.

Practically speaking for nightly benchmarks we generally rely on the bundled jdk, but if any user or internal tool needs to specify a different java version while we do add the bin directory in PATH we also specify JAVA_HOME which we define at least in

env["JAVA_HOME"] = java_home
.

As far as I understand we won't be broken right now given that JAVA_HOME/bin is in the PATH and Elasticsearch 8.0.0 will just ignore the environment variable JAVA_HOME. Therefore the priority for fixing this is not immediate.

Regarding the fix I think we need to:

  1. Rely on ES_JAVA_HOME when the distribution-version is >=8.0.0
  2. Rely on JAVA_HOME always when building Elasticsearch from source (when using the pipeline from-sources
  3. Adjust and enhance unit tests/IT tests as required

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions