Skip to content

RDMR-1428 Bump the Java default targets to 21 - #40

Merged
EiyuuZack merged 2 commits into
outsystems/15.1.xfrom
feat/RDMR-1428/java21-defaults
Aug 17, 2026
Merged

RDMR-1428 Bump the Java default targets to 21#40
EiyuuZack merged 2 commits into
outsystems/15.1.xfrom
feat/RDMR-1428/java21-defaults

Conversation

@EiyuuZack

@EiyuuZack EiyuuZack commented Aug 14, 2026

Copy link
Copy Markdown

Why

The shared SQLite connector is compiled with JDK 21 — sqlite-mobile/ndk-connector/Makefile runs javac -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_COMPATIBILITY and JAVA_TARGET_COMPATIBILITY move from 11 to 21 in cdv-gradle-config-defaults.json. Two lines.

CI moves to JDK 21 as well. The java-unit-tests job builds test/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 with error: invalid source release: 21.

KOTLIN_JVM_TARGET stays null. Nothing has read it since 8d3bd1ea removed 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

  • Fork JS unit suite: 338 specs pass.
  • A bare project with no preferences set, built against this fork: cdv-gradle-config.json reports 21 / 21, the build succeeds, and both the app and CordovaLib modules compile at Java 21.
  • The same project on JDK 17 fails as expected, with error: invalid source release: 21.
  • It also builds on Android Studio's bundled JDK 25, and the output is still Java 21.

References https://outsystemsrd.atlassian.net/browse/RDMR-1428

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
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
@EiyuuZack EiyuuZack self-assigned this Aug 14, 2026
@EiyuuZack
EiyuuZack merged commit 59d4bfe into outsystems/15.1.x Aug 17, 2026
15 checks passed
@EiyuuZack
EiyuuZack deleted the feat/RDMR-1428/java21-defaults branch August 17, 2026 11:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants