Require JDK 25 with an actionable pre-flight error; drop legacy 6.08 docs#7665
Open
Vest wants to merge 1 commit into
Open
Require JDK 25 with an actionable pre-flight error; drop legacy 6.08 docs#7665Vest wants to merge 1 commit into
Vest wants to merge 1 commit into
Conversation
cfe612e to
3a4101a
Compare
…docs build.gradle: install a taskGraph.whenReady hook that resolves the Java toolchain before any JavaCompile task runs. On failure, replace Gradle's "Toolchain download repositories have not been configured" message with the daemon's current version, its java.home, four vendor download links, and the exact -Porg.gradle.java.installations.paths invocation. Non-compile tasks (help, tasks, javaToolchains) are unaffected, so newcomers can still introspect their setup. README.md: master ships 6.09 — drop the parallel 6.08 install path (JDK 11 recommendation, separate TOC entry, "6.09 (Alpha)" qualifier on the remaining install section) and simplify the dev-Java line to just name JDK 25.
3a4101a to
3a33d5e
Compare
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.
Improves the newcomer / drive-by-contributor experience for the JDK 25 requirement introduced in #7611. Two orthogonal but paired changes.
Problem
A contributor testing PR #7660 on Windows 10 with an older JDK hit:
The error is accurate but opaque — it points at a build.gradle line unrelated to the actual problem, doesn't name what version is required, doesn't name what version the user has, and doesn't tell them where to get a matching JDK. Meanwhile the README still documents parallel 6.08 (JDK 11) and 6.09 (JDK 25) install paths, which is confusing for someone landing on master trying to figure out which one applies.
build.gradle — pre-flight toolchain check
Installs a
gradle.taskGraph.whenReadyhook that callsjavaToolchains.launcherFor(java.toolchain).get()before anyJavaCompiletask runs. This uses the same resolution pathcompileJavaitself would use, so it correctly accepts every legitimate setup:JAVA_HOMEpointing at JDK 25+-Porg.gradle.java.installations.paths=<path>(the friend's workaround)~/.gradle/gradle.propertiesorg.gradle.java.installations.pathsOn failure, replaces the opaque error with:
The check fires only when a task in the graph is a
JavaCompile, so./gradlew help,./gradlew tasks,./gradlew javaToolchains, and./gradlew --versionremain usable even without JDK 25 installed — anewcomer can still run
./gradlew -q javaToolchainsto discover what JDKs their machine has.Required version is sourced from
project.ext.javaVersion(i.e.gradle.properties), so future bumps stay one-line changes per the README's "Bumping Java / JavaFX versions" section.Why not auto-download the JDK?
Auto-provisioning a JDK 25 (e.g. via the Foojay resolver plugin) would require adding a new plugin dependency, and installing the toolchain is not a build responsibility PCGen wants to take on — it's fine for it to be a prerequisite the contributor handles once. Recent commits have been moving in the opposite direction:
af1640a877 Drop controlsfx dependency,e23ea79cb7 build.gradle: drop stale forceMerge entries, etc. This PR adds no dependency; it only improves the diagnostic when the prerequisite is missing.README.md — drop 6.08
Current version is
6.09.08.RC1and every recent tag is 6.09.x. The README documented 6.08 and 6.09 install paths in parallel:Installing From Release 6.08Installing From Release 6.09 (Alpha)Removed:
Kept:
Installing PCGenVerified
./gradlew help./gradlew compileJava --dry-runjavaToolchains.launcherFor(...)on machine with JDK 25 (positive path for compile tasks)Not verified locally: the negative path (message renders when no JDK 25 present), because my machine has JDK 25. The logic is small and eyeballable, but if a reviewer wants end-to-end confidence, temporarily bumping
javaVersion=99ingradle.propertieswill trigger it.Out of scope
6.09.xx-in-a-URL patterns in the remaining install instructions — that's a docs decision about tracking/releases/latestvs. explicit versioning, deserves its own PR.