Repository navigation
build: Pin the Gradle daemon to JDK 21 - #6364
Draft
runningcode wants to merge 2 commits into
Draft
runningcode wants to merge 2 commits into
runningcode wants to merge 2 commits into
Conversation
Since #6242 the build needs JDK 21 to run Gradle. Daemon JVM criteria let Gradle pick an installed JDK 21 regardless of JAVA_HOME. Also write a heap dump on daemon OOM instead of crashing, and silence Gradle's welcome message and Android Studio's AGP upgrade prompt. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
📲 Install BuildsAndroid
|
The daemon JVM criteria only accept JDK 21, so the check can't fail. CONTRIBUTING.md no longer claims a newer JDK runs the build. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
romtsn
approved these changes
Oct 23, 2026
This branch has not been deployed
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.
📜 Description
gradle/gradle-daemon-jvm.propertieswithtoolchainVersion=21. Gradle then starts the daemon on an installed JDK 21, whateverJAVA_HOMEpoints to.build.gradle.kts, and updateCONTRIBUTING.mdto match.-XX:+CrashOnOutOfMemoryErrorwith-XX:+HeapDumpOnOutOfMemoryErrorin the daemon JVM args. A daemon that runs out of memory now writes a heap dump to analyze instead of crashing.org.gradle.welcome=neverto skip Gradle's welcome message.android.disableAgpUpgradePrompt=trueto stop Android Studio prompting to upgrade AGP.💡 Motivation and Context
Since #6242 the build requires JDK 21. If
JAVA_HOMEpoints to an older JDK, it fails with "This build requires JDK 21 or newer". With the daemon JVM pinned,./gradlewworks without switchingJAVA_HOMEfirst.toolchainVersion=21only accepts JDK 21, not newer ones, so the check inbuild.gradle.ktscan no longer fail.CONTRIBUTING.mdsaid a newer JDK runs the build, which is no longer true.Without a JDK 21 installed, Gradle now fails before configuring the build with "Unable to download toolchain matching the requirements ({languageVersion=21, ...})". This isn't a new requirement: compilation already uses a JDK 21 toolchain, and the build doesn't configure any toolchain downloads.
💚 How did you test it?
Ran
./gradlew spotlessApply apiDumpwithJAVA_HOMEset to JDK 17. The daemon started on JDK 21 and the build passed.In throwaway projects:
📝 Checklist
sendDefaultPIIis enabled.🔮 Next steps
None.
#skip-changelog
🤖 Generated with Claude Code