From df39e74cdb5c65d7c1775ac3a14e9cb1e3e124ea Mon Sep 17 00:00:00 2001 From: Jun Luo <4catcode@gmail.com> Date: Tue, 21 Apr 2026 11:05:56 +0800 Subject: [PATCH] chore: bump Java/Kotlin toolchain to JDK 21 Modernizes the build toolchain to the current LTS. The published SDK jar is unchanged: compileJava now pins 'options.release = 8' so the emitted bytecode and the API surface stay JDK 8 compatible. --- build.gradle.kts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index ab6c0d2a8..91412af2b 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -16,12 +16,14 @@ version = "2.2.3" java { toolchain { - languageVersion = JavaLanguageVersion.of(8) + // Tests and Kotlin compilation use JDK 21. The published SDK jar + // still targets JDK 8 bytecode via `options.release = 8` below. + languageVersion = JavaLanguageVersion.of(21) } } kotlin { - jvmToolchain(8) + jvmToolchain(21) } repositories { @@ -145,6 +147,7 @@ tasks { compileJava { options.encoding = "UTF-8" + options.release = 8 } compileTestJava {