-
Notifications
You must be signed in to change notification settings - Fork 72
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create a Java 17 image that also contains Java 20 #248
Conversation
5e3ef16
to
1c5f515
Compare
This can be used with Groovy DSL java {
toolchain {
languageVersion = JavaLanguageVersion.of(20)
}
}
kotlin {
jvmToolchain {
languageVersion = JavaLanguageVersion.of(20)
}
} or java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(20))
}
}
kotlin {
jvmToolchain {
languageVersion.set(JavaLanguageVersion.of(20))
}
} And invoke gradle with these args
|
1c5f515
to
d94cb74
Compare
These properties could be set inside .gradle/gradle.properties, so that they are automatically read and used by the gradle command |
That's true, but I thought that would be inconvenient for running your project locally. |
What I meant was to set these properties inside the docker image, so that only when running gradle from the image the toolchain whould be manually set. I don't think it will impact using gradle locally |
Oh, with |
I was actually thinking about creating a file inside the docker image, but an ENV is also a good option |
Does anyone have a need for this image? Should we go forward with creating it? |
We're currently stuck on an old jdk19/gradle8.0 build of docker-gradle. We're using jdk19 and want to upgrade to jdk20 and Gradle 8.2, but can't due a build with jdk20 is missing. |
d94cb74
to
c2e7e9c
Compare
@MartelliEnrico I see which file you mean now (I originally thought you meant the project's .gradle directory). That is a good suggestion. since that will make it less likely to be accidentally wiped out by people setting their own |
@jurriaan I held off on making another image I'd have to maintain because I wasn't sure anyone needed this. Now that you said you do, I'll proceed with merging it. |
@keeganwitt JDK20 is supported with Kotlin 1.9.0, right? Am I correct that this JDK 17 + 20 approach isn't needed anymore when gradle/gradle#25777 is merged? Maybe we can wait for that instead of releasing this combined image? |
That's right, but there hasn't been a version of Gradle released that is on Kotlin 1.9.0. The last I saw in the linked issue, it will be shipped in Gradle 8.3. I'd rather wait, since then we won't have the confusion of when this new image is EOL, but it's really up to whatever people need. |
c2e7e9c
to
a4278a7
Compare
73dac78
to
32ff372
Compare
for use with Gradle 8.1 and 8.2
32ff372
to
5bcd3d1
Compare
8.3 just got released this morning! https://docs.gradle.org/8.3/release-notes.html#full-support-for-java-20 |
The latest (8.1.1) release notes say
They also note this in their compatibility guide.
My hope was that full Java 20 support was coming soon, but it sounds like it might not be until 8.2 (July). See the issue gradle/gradle#23488.
This PR adds an image based on the Java 17 image but also installs Java 20 so that you can use it in a toolchain.