Skip to content

Commit

Permalink
[script] Explicitly tell the user to set their JAVA_HOME if their JDK…
Browse files Browse the repository at this point in the history
… version is invalid (#1181)
  • Loading branch information
kvargha authored Sep 17, 2024
1 parent 37ea7b3 commit 7a37d02
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -805,7 +805,9 @@ task verifyJdkVersion {
def currentJdkVersion = JavaVersion.current()
def isSupported = supportedJdkVersions.any {version -> currentJdkVersion.equals(version) }
if (!isSupported) {
throw new GradleException("Invalid JDK version: ${currentJdkVersion}. Supported versions: ${supportedJdkVersions.join(', ')}.")
throw new GradleException("Invalid JDK version: ${currentJdkVersion}.\n" + \
"Supported versions: ${supportedJdkVersions.join(', ')}.\n" + \
"Please set the JAVA_HOME environment variable to a supported version either locally or globally.")
}
println "JDK version ${currentJdkVersion} is valid."
}
Expand Down

0 comments on commit 7a37d02

Please sign in to comment.