Skip to content

Commit cde51b1

Browse files
committed
[SPARK-53670] Use Gradle Java Toolchain
### What changes were proposed in this pull request? This PR aims to use `Gradle Java Toolchain` to ensure to use JDK 17 API Compatibility. ### Why are the changes needed? In addition to `sourceCompatibility` and `targetCompatibility`, `Toolchain` will ensure `--release` too. ### Does this PR introduce _any_ user-facing change? No behavior change. ### How was this patch tested? Pass the CIs. ### Was this patch authored or co-authored using generative AI tooling? No. Closes #333 from dongjoon-hyun/SPARK-53670. Authored-by: Dongjoon Hyun <[email protected]> Signed-off-by: Dongjoon Hyun <[email protected]>
1 parent ad3d2dc commit cde51b1

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

build.gradle

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,13 @@ subprojects {
5050
apply plugin: 'java'
5151

5252
java {
53-
sourceCompatibility = 17
54-
targetCompatibility = 17
53+
toolchain {
54+
languageVersion = JavaLanguageVersion.of(17)
55+
}
56+
}
57+
58+
tasks.withType(JavaCompile).configureEach {
59+
options.release = 17
5560
}
5661

5762
repositories {

0 commit comments

Comments
 (0)