diff --git a/buildSrc/src/main/java/org/elasticsearch/gradle/testclusters/ElasticsearchNode.java b/buildSrc/src/main/java/org/elasticsearch/gradle/testclusters/ElasticsearchNode.java index 86d05cd93649d..7670bee959ba1 100644 --- a/buildSrc/src/main/java/org/elasticsearch/gradle/testclusters/ElasticsearchNode.java +++ b/buildSrc/src/main/java/org/elasticsearch/gradle/testclusters/ElasticsearchNode.java @@ -651,7 +651,7 @@ private void runElasticsearchBinScript(String tool, CharSequence... args) { private Map getESEnvironment() { Map defaultEnv = new HashMap<>(); // If we are testing the current version of Elasticsearch, use the configured runtime Java, otherwise use the bundled JDK - if (getTestDistribution() == TestDistribution.INTEG_TEST || getVersion().toString().equals(VersionProperties.getElasticsearch())) { + if (getTestDistribution() == TestDistribution.INTEG_TEST || getVersion().equals(VersionProperties.getElasticsearchVersion())) { defaultEnv.put("JAVA_HOME", BuildParams.getRuntimeJavaHome().getAbsolutePath()); } defaultEnv.put("ES_PATH_CONF", configFile.getParent().toString());