Skip to content

Commit beeb233

Browse files
phraktleclaude
andcommitted
build: bump build toolchain to JDK 17, keep Java 8 bytecode target
Gradle 9's default checkstyle toolVersion (~10.21+) requires Java 11+ to run, but every module pinned a Java 8 toolchain, so Gradle routed the Checkstyle task's launcher through JDK 8 and the Ant task class (class file version 55) failed to load on the JDK 8 runtime. Rather than pin an old checkstyle or splice a separate launcher just for Checkstyle, bump the build toolchain to JDK 17 in every module and set `options.release = 8` on the library modules. Net effect: - compile/checkstyle/javadoc all run on the same modern JVM - published jars still contain class file version 52 (Java 8) — the library's consumer baseline is unchanged (verified on ImGui.class) - CI only needs to install JDK 17 (dropped the dual 8+17 setup) Also bump foojay-resolver-convention 0.10.0 -> 1.0.0. Gradle 9 removed JvmVendorSpec.IBM_SEMERU; the 0.10.0 plugin references it in its <clinit>, so any local build that has to download a toolchain (no matching JDK already installed) crashes with NoSuchFieldError before reaching the task graph. CI didn't hit this because setup-java pre-installs the JDKs. Verified: ./gradlew buildAll green on JDK 25 / macOS arm64; javap on the produced ImGui.class reports major version 52. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 45b6de8 commit beeb233

7 files changed

Lines changed: 21 additions & 15 deletions

File tree

.github/workflows/ci.yml

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,7 @@ jobs:
2424
uses: actions/setup-java@v5
2525
with:
2626
distribution: liberica
27-
java-version: |
28-
8
29-
17
27+
java-version: 17
3028

3129
- name: Setup Gradle
3230
uses: gradle/actions/setup-gradle@v5
@@ -73,9 +71,7 @@ jobs:
7371
uses: actions/setup-java@v5
7472
with:
7573
distribution: liberica
76-
java-version: |
77-
8
78-
17
74+
java-version: 17
7975

8076
- name: Setup Gradle
8177
uses: gradle/actions/setup-gradle@v5
@@ -162,9 +158,7 @@ jobs:
162158
uses: actions/setup-java@v5
163159
with:
164160
distribution: liberica
165-
java-version: |
166-
8
167-
17
161+
java-version: 17
168162

169163
- name: Setup Gradle
170164
uses: gradle/actions/setup-gradle@v5

example/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ plugins {
44

55
java {
66
toolchain {
7-
languageVersion.set(JavaLanguageVersion.of(8))
7+
languageVersion.set(JavaLanguageVersion.of(17))
88
}
99
}
1010

imgui-app/build.gradle

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,14 @@ plugins {
88

99
java {
1010
toolchain {
11-
languageVersion.set(JavaLanguageVersion.of(8))
11+
languageVersion.set(JavaLanguageVersion.of(17))
1212
}
1313
}
1414

15+
tasks.withType(JavaCompile).configureEach {
16+
options.release.set(8)
17+
}
18+
1519
dependencies {
1620
api platform("org.lwjgl:lwjgl-bom:$lwjglVersion")
1721

imgui-binding-natives/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ plugins {
66

77
java {
88
toolchain {
9-
languageVersion.set(JavaLanguageVersion.of(8))
9+
languageVersion.set(JavaLanguageVersion.of(17))
1010
}
1111
}
1212

imgui-binding/build.gradle

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,14 @@ plugins {
1010

1111
java {
1212
toolchain {
13-
languageVersion.set(JavaLanguageVersion.of(8))
13+
languageVersion.set(JavaLanguageVersion.of(17))
1414
}
1515
}
1616

17+
tasks.withType(JavaCompile).configureEach {
18+
options.release.set(8)
19+
}
20+
1721
dependencies {
1822
testImplementation("org.junit.jupiter:junit-jupiter-api:5.13.4")
1923
testImplementation("org.junit.jupiter:junit-jupiter-engine:5.13.4")

imgui-lwjgl3/build.gradle

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,14 @@ plugins {
77

88
java {
99
toolchain {
10-
languageVersion.set(JavaLanguageVersion.of(8))
10+
languageVersion.set(JavaLanguageVersion.of(17))
1111
}
1212
}
1313

14+
tasks.withType(JavaCompile).configureEach {
15+
options.release.set(8)
16+
}
17+
1418
dependencies {
1519
implementation platform("org.lwjgl:lwjgl-bom:$lwjglVersion")
1620

settings.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
plugins {
2-
id("org.gradle.toolchains.foojay-resolver-convention") version("0.10.0")
2+
id("org.gradle.toolchains.foojay-resolver-convention") version("1.0.0")
33
}
44

55
rootProject.name = "imgui-java"

0 commit comments

Comments
 (0)