Skip to content

[xabt] build with & allow android projects to use JDK 25 - #12478

Open
jonathanpeppers wants to merge 1 commit into
mainfrom
jonathanpeppers-update-openjdk-25-0-4-1
Open

[xabt] build with & allow android projects to use JDK 25#12478
jonathanpeppers wants to merge 1 commit into
mainfrom
jonathanpeppers-update-openjdk-25-0-4-1

Conversation

@jonathanpeppers

@jonathanpeppers jonathanpeppers commented Aug 21, 2026

Copy link
Copy Markdown
Member

Summary

Build dotnet/android with Microsoft OpenJDK 25.0.4.1 and support Android projects using JDK 21 or JDK 25.

Java 25 requires Gradle 9.1 or newer. Java.Interop now uses the repository-wide Gradle 9.5 wrapper instead of its duplicate Gradle 8.12 wrapper, and java-source-utils uses the Gradle 9 application.mainClass API.

Current product builds and build-task tests use the downloaded JDK 25 toolchain. Coverage that intentionally exercises the previous stable Android workload, emulator scenarios using that workload, and MAUI's Gradle 8.13 wrapper uses the agents' JDK 21 installation. This preserves those compatibility tests without weakening the current workload's JDK 25 coverage.

Android command-line tools are updated from 19.0 to 23.0 because lint 8.9.0 could not parse Microsoft OpenJDK's four-part 25.0.4.1 version. Command-line tools 23.0 include lint 9.4, which runs successfully on OpenJDK 25.0.4.1. Bundletool remains at 1.18.3 because it is already the latest release.

JDK 25 also emits runtime diagnostics for restricted native access and terminally deprecated sun.misc.Unsafe access in Android's Java tools. The build tasks add the JDK compatibility switches for bundletool, apksigner, and lint on JDK 24 or newer while preserving existing JavaOptions/JAVA_OPTS and leaving JDK 21 unchanged.

The public installer JDK default and public installation documentation remain unchanged.

Changes

  • update the bootstrap Microsoft OpenJDK from 21.0.8 to 25.0.4.1
  • require JDK 21 or newer and allow JDK 25 releases through 25.0.99
  • define JDK 21 as the CI compatibility baseline and JDK 25 as the latest build toolchain
  • run current workload coverage on JDK 25 and legacy-workload/emulator/MAUI coverage on JDK 21
  • share the repository-wide Gradle 9.5 wrapper with Java.Interop and remove its duplicate Gradle 8.12 wrapper
  • update java-source-utils for the Gradle 9 application API
  • update Android command-line tools from 19.0 to 23.0, including separate macOS x64 and arm64 archives
  • accept both JDK 21 and JDK 25 javac syntax diagnostic wording
  • suppress JDK 24+ native-access and sun.misc.Unsafe diagnostics for bundletool, apksigner, and lint

Validation

  • built src\openjdk\openjdk.csproj and verified OpenJDK 25.0.4.1+1 LTS
  • built src\androidsdk\androidsdk.csproj with command-line tools 23.0
  • ran lint 9.4 under Microsoft OpenJDK 25.0.4.1
  • ran the MSBuild-driven java-source-utils tests and compiled its Kotlin fixture with Gradle 9.5 under JDK 25
  • built Xamarin.Android.Build.Tasks and the affected build-test assembly
  • passed all JavaToolTaskTests

Copilot AI lite review requested due to automatic review settings August 21, 2026 16:08

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the bootstrap Microsoft OpenJDK to 25.0.4.1 and enables Android projects to use JDK versions through 25.0.99.

Changes:

  • Updates OpenJDK version and installation metadata.
  • Raises the supported Java version ceiling.
  • Refreshes archive-layout documentation.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
src/Xamarin.Android.Build.Tasks/Xamarin.Android.Common.props.in Raises the supported JDK maximum.
src/openjdk/openjdk.targets Updates OpenJDK archive documentation.
Configuration.props Pins the bootstrap JDK to 25.0.4.1.
Suppressed comments (3)

Configuration.props:140

  • 💡 documentation — This changes the repository's default/bootstrap JDK to 25.0.4.1, but the user-facing manual-install guide still tells users to download Microsoft OpenJDK 21 (Documentation/docs-mobile/getting-started/installation/dependencies.md:49-52). Please update that recommendation/link to 25, or explicitly document the supported range if 21 is intentionally still preferred, so the guidance matches the new default.
    <MicrosoftOpenJDKVersion Condition="'$(MicrosoftOpenJDKVersion)' == ''">25.0.4.1</MicrosoftOpenJDKVersion>

src/Xamarin.Android.Build.Tasks/Xamarin.Android.Common.props.in:20

  • 🤖 ⚠️ Testing — This changes the production JDK acceptance ceiling, but the existing ValidateJavaVersionTests only exercise ceilings up to 17.99.0/11.0.99. Please add a 25.x acceptance case and a just-over-25.0.99 rejection case so the new support boundary is regression-tested.
		<LatestSupportedJavaVersion Condition="'$(LatestSupportedJavaVersion)' == ''">25.0.99</LatestSupportedJavaVersion>

src/openjdk/openjdk.targets:43

  • 🤖 💡 Documentation — This checksum prefix was copied from the 21.0.8 example but the filename now names 25.0.4.1, so the example is misleading. Replace it with the actual 25.0.4.1 prefix or use a generic placeholder rather than documenting a stale hash.

Rule: Documentation must match the implementation.

         File format: "6ecfa864...  microsoft-jdk-25.0.4.1-windows-x64.zip" -->

@jonathanpeppers
jonathanpeppers force-pushed the jonathanpeppers-update-openjdk-25-0-4-1 branch 2 times, most recently from fe19368 to fa7120c Compare August 21, 2026 21:01
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: d50f9130-e4d8-4d1c-9097-5a61e52374e3
@jonathanpeppers
jonathanpeppers force-pushed the jonathanpeppers-update-openjdk-25-0-4-1 branch from fa7120c to 7481b9d Compare August 23, 2026 13:32
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