RDMR-1428 Bump the Java default targets to 21 - #40
Merged
Conversation
The engine defaulted to Java 11, so any project that did not set the compatibility preferences emitted class-file major 55 while building against AGP 9.2.1 and Kotlin 2.2.20. MABS 13 ships JDK 21 and no AGP below 9, so 11 is no longer a default worth carrying. Projects that do not set AndroidJavaSourceCompatibility or AndroidJavaTargetCompatibility now compile at Java 21 and need a JDK 21 or newer build host. MABS 13 agents and CI already provide one, so the floor is documented rather than newly imposed. KOTLIN_JVM_TARGET stays null deliberately. Nothing has consumed it since the KGP wiring was removed in 8d3bd1e, and AGP 9's built-in Kotlin derives its jvmTarget from the module's Java target compatibility, so this raise carries Kotlin with it. Pinning it to a literal 21 would reintroduce a value that can drift from JAVA_TARGET_COMPATIBILITY once either is overridden, for no gain. References https://outsystemsrd.atlassian.net/browse/RDMR-1428
The java-unit-tests job builds test/androidx, a bare project that takes its compileOptions from cdv-gradle-config-defaults.json. Raising those defaults to Java 21 therefore requires a JDK 21 runner: on 17 the fixture fails at ':CordovaLib:compileDebugJavaWithJavac' with "error: invalid source release: 21". This is the same floor the defaults raise imposes on any bare project, so CI has to meet it rather than work around it. References https://outsystemsrd.atlassian.net/browse/RDMR-1428
EiyuuZack
requested review from
a team,
Chuckytuh,
OS-kepatotorica,
OS-ruialves,
benmccarty91,
trevor-lambert and
usernuno
and removed request for
a team
August 14, 2026 17:02
Chuckytuh
approved these changes
Aug 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
The shared SQLite connector is compiled with JDK 21 —
sqlite-mobile/ndk-connector/Makefilerunsjavac -source 21 -target 21. A JDK 17 compiler cannot read classes produced by JDK 21, so every OutSystems Android build already requires a JDK 21 build host (see RDMR-1425).Given that, defaulting the engine to Java 11 buys nothing. We would be compiling to an old Java level on a toolchain that is necessarily 21 or newer. This raise brings the defaults in line with how the shells are actually built.
What changes
JAVA_SOURCE_COMPATIBILITYandJAVA_TARGET_COMPATIBILITYmove from 11 to 21 incdv-gradle-config-defaults.json. Two lines.CI moves to JDK 21 as well. The
java-unit-testsjob buildstest/androidx, a bare project that takes its settings from these defaults, so the runner has to meet the same floor. On JDK 17 it fails witherror: invalid source release: 21.KOTLIN_JVM_TARGETstaysnull. Nothing has read it since8d3bd1earemoved the Kotlin Gradle Plugin wiring, and AGP 9's built-in Kotlin takes its target from the module's Java target — so Kotlin follows this raise on its own. Pinning it to 21 would only create a value that can drift if a project overrides the Java target.Who is affected
A project that sets neither preference now compiles at Java 21 and needs a JDK 21 build host. This is not marked as a breaking change: MABS 13 agents and CI already provide JDK 21.
The NativeShell template sets both preferences explicitly on its own RDMR-1428 branch, so template consumers land on Java 21 either way.
Testing
cdv-gradle-config.jsonreports 21 / 21, the build succeeds, and both the app and CordovaLib modules compile at Java 21.error: invalid source release: 21.References https://outsystemsrd.atlassian.net/browse/RDMR-1428