Skip to content

Setting the version of java via gradle - #78

Open
rokadias wants to merge 1 commit into
mainfrom
saqib/set-java-version-via-gradle
Open

rokadias wants to merge 1 commit into
mainfrom
saqib/set-java-version-via-gradle

Conversation

@rokadias

Copy link
Copy Markdown
Contributor

I've accidentally deployed to the robot using java 21 since that's what my language server uses, and I've had students have issues with getting the "right" java version installed.

Excerpt:

Using Java toolchains allows Gradle to automatically download and manage the required JDK version for your build. It ensures that the correct Java version is used for both compilation and execution.

https://docs.gradle.org/current/userguide/toolchains.html#sec:using-java-toolchains

@aschokking

Copy link
Copy Markdown
Contributor

CI is failing on this one

@rokadias
rokadias requested a review from a team as a code owner November 14, 2026 22:18
@aschokking

Copy link
Copy Markdown
Contributor

CI still failing :(

@rokadias
rokadias force-pushed the saqib/set-java-version-via-gradle branch from 5d57f42 to 71d41f9 Compare November 15, 2026 02:11
@rokadias

Copy link
Copy Markdown
Contributor Author

CI still failing :(

Yeah, kind of intentional proves that it's working when it doesn't match the version. Updated the version now, and should pass if it matches what happened on SeriouslyCommonLib.

Comment thread build.gradle
}
}

java {

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.

There's already a Java block above right? I'm a little confused about what's different here

java {
    toolchain {
        languageVersion = JavaLanguageVersion.of(25)
    }
    sourceCompatibility = JavaVersion.VERSION_25
    targetCompatibility = JavaVersion.VERSION_25
}

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