Skip to content

Commit 9f55f03

Browse files
committed
Improve message when JAVA_HOME not set (#32022)
closes #31399
1 parent 113d6d5 commit 9f55f03

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

buildSrc/src/main/groovy/org/elasticsearch/gradle/BuildPlugin.groovy

+5-1
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,11 @@ class BuildPlugin implements Plugin<Project> {
222222
// IntelliJ does not set JAVA_HOME, so we use the JDK that Gradle was run with
223223
return Jvm.current().javaHome
224224
} else {
225-
throw new GradleException("JAVA_HOME must be set to build Elasticsearch")
225+
throw new GradleException(
226+
"JAVA_HOME must be set to build Elasticsearch. " +
227+
"Note that if the variable was just set you might have to run `./gradlew --stop` for " +
228+
"it to be picked up. See https://github.com/elastic/elasticsearch/issues/31399 details."
229+
)
226230
}
227231
}
228232
return javaHome

0 commit comments

Comments
 (0)