From 291c94ffe157cd573e07bd4914fcd0a6ef42d3c9 Mon Sep 17 00:00:00 2001 From: Joseph Doherty Date: Fri, 26 Jun 2026 16:02:48 -0400 Subject: [PATCH] build(java-client): retarget JDK 21 -> 17 for Ignition 8.3 (v0.2.0) Ignition 8.3 runs on JDK 17; the 0.1.2 client was compiled --release 21 (class-file v65) and would throw UnsupportedClassVersionError when loaded in an Ignition module. Drop the toolchain and bytecode target to 17 so the artifact loads on the gateway (a 17 build still runs on 21+). No source uses Java 18-21 APIs, so this is a pure target change. Bump 0.1.2 -> 0.2.0. Update the toolchain-pinning smoke test to assert feature()==17. All 97 tests pass; all jar classes verified class-file v61. Roadmap G0. --- clients/java/build.gradle | 8 +++++--- .../ww/mxgateway/client/GeneratedContractSmokeTests.java | 6 ++++-- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/clients/java/build.gradle b/clients/java/build.gradle index 6e152e5..912a056 100644 --- a/clients/java/build.gradle +++ b/clients/java/build.gradle @@ -13,18 +13,20 @@ ext { subprojects { group = 'com.zb.mom.ww.mxgateway' - version = '0.1.2' + version = '0.2.0' pluginManager.withPlugin('java') { java { + // Retargeted 21 -> 17 so the artifact loads on Ignition 8.3's JDK 17 + // (a 17-targeted build still runs on 21+). See roadmap G0. toolchain { - languageVersion = JavaLanguageVersion.of(21) + languageVersion = JavaLanguageVersion.of(17) } } tasks.withType(JavaCompile).configureEach { options.encoding = 'UTF-8' - options.release = 21 + options.release = 17 } tasks.withType(Test).configureEach { diff --git a/clients/java/zb-mom-ww-mxgateway-client/src/test/java/com/zb/mom/ww/mxgateway/client/GeneratedContractSmokeTests.java b/clients/java/zb-mom-ww-mxgateway-client/src/test/java/com/zb/mom/ww/mxgateway/client/GeneratedContractSmokeTests.java index dee8855..3c31802 100644 --- a/clients/java/zb-mom-ww-mxgateway-client/src/test/java/com/zb/mom/ww/mxgateway/client/GeneratedContractSmokeTests.java +++ b/clients/java/zb-mom-ww-mxgateway-client/src/test/java/com/zb/mom/ww/mxgateway/client/GeneratedContractSmokeTests.java @@ -23,7 +23,9 @@ final class GeneratedContractSmokeTests { } @Test - void javaTwentyOneToolchainRunsTests() { - assertEquals(21, Runtime.version().feature()); + void javaSeventeenToolchainRunsTests() { + // Pinned to 17: the client is retargeted to JDK 17 so it loads on + // Ignition 8.3's JDK 17 runtime (roadmap G0). A 17 build still runs on 21+. + assertEquals(17, Runtime.version().feature()); } }