Repository navigation
chore: Download the JDKs that the build does not find - #124
Merged
Merged
Conversation
The foojay toolchain resolver lets Gradle download the JDKs it needs when they are not installed: those that the jars are compiled with, and Java 25 for Gradle itself, whose download URLs are written into gradle/gradle-daemon-jvm.properties by updateDaemonJvm. The README and CONTRIBUTING.md no longer ask to install JDK 25 and JDK 21.
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.
What and why
Building the project needed JDK 25, which Gradle runs on, and JDK 21, which the jars for older Minecraft versions are compiled with, installed by hand. Gradle can download missing JDKs itself once it knows where from, so this adds a toolchain resolver.
org.gradle.toolchains.foojay-resolver-convention1.0.0). Gradle downloads a toolchain into~/.gradle/jdkswhen no installed JDK matches. A comment says what it downloads and that Gradle itself needs Java 25 for Loom 1.18../gradlew updateDaemonJvm --jvm-version=25, with a download URL of Java 25 for each operating system and architecture (Eclipse Adoptium Temurin 25.0.5). The JDK for Gradle itself stays at that version until the task is run again.CI installs its JDKs with
setup-javaand passes them to Gradle, so it should not download any.How it was tested
JAVA_HOMEand with-Porg.gradle.java.installations.auto-detect=false,:curvebuilding-fabric:1.21.1:compileJavadownloaded JDK 21 (Temurin 21.0.13) and compiled with it.PATH, Gradle downloaded JDK 25 (Temurin 25.0.5) and ran on it../gradlew build checkCodeStyle --warning-mode all: the build and unit tests pass, with no Gradle, javac or Checkstyle warnings.Notes