-
Notifications
You must be signed in to change notification settings - Fork 329
Don't set JAVA_HOME starting with ES 8.0 #1191
Description
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
rally/esrally/mechanic/launcher.py
Line 176 in 5679af3
| 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:
- Rely on
ES_JAVA_HOMEwhen the distribution-version is >=8.0.0 - Rely on
JAVA_HOMEalways when building Elasticsearch from source (when using the pipeline from-sources - Adjust and enhance unit tests/IT tests as required