Skip to content
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

Java 21 Image #260

Closed
pipinet opened this issue Sep 20, 2023 · 17 comments
Closed

Java 21 Image #260

pipinet opened this issue Sep 20, 2023 · 17 comments

Comments

@pipinet
Copy link

pipinet commented Sep 20, 2023

No description provided.

@sergey-morenets
Copy link

Hi

Do you have any updates/ETA for this issue? JDK 21 was released 3 weeks ago. Gradle 8.4 was released 5 days ago. However Dockerfile here still uses JDK 20.

@keeganwitt
Copy link
Owner

All I know about it is here: adoptium/containers#427.

I can't release it until they do.

@keeganwitt
Copy link
Owner

They released the images for 21 today.

But another problem: Gradle doesn't support it yet. Similar to the issue we had with Java 20 (#247).

@keeganwitt
Copy link
Owner

I'll merge the new images, but they won't be published until Gradle announces support for Java 21. Please reply to this thread if you require an image that has both Java 17 (for launching Gradle) and Java 21 for use in compilation via a toolchain.

keeganwitt added a commit that referenced this issue Oct 11, 2023
@keeganwitt
Copy link
Owner

#265 creates images with both Java 17 and 21. If that's needed by anyone, let me know. This is a bit better situation than what we had with Java 20 because at least both versions are LTS releases.

@floriandreher
Copy link

#265 creates images with both Java 17 and 21. If that's needed by anyone, let me know. This is a bit better situation than what we had with Java 20 because at least both versions are LTS releases.

It would be cool to have this image :)

@sergey-morenets
Copy link

#265 creates images with both Java 17 and 21. If that's needed by anyone, let me know. This is a bit better situation than what we had with Java 20 because at least both versions are LTS releases.

It would be cool to have this image :)

For me as well. Gradle already claimed support for JDK 21 (if you use Gradle 8.4 and Groovy scripts).

@floriandreher
Copy link

For me as well. Gradle already claimed support for JDK 21 (if you use Gradle 8.4 and Groovy scripts).

So is JDK 21 fully supported for using build.gradle groovy setup?
If this is true, can't be the plain JDK 21 image be published and be used for projects using groovy setup?

@keeganwitt
Copy link
Owner

For me as well. Gradle already claimed support for JDK 21 (if you use Gradle 8.4 and Groovy scripts).

So is JDK 21 fully supported for using build.gradle groovy setup? If this is true, can't be the plain JDK 21 image be published and be used for projects using groovy setup?

Not that I've seen. If someone can point to somewhere Gradle has stated this, I'll publish the 21 images.

@sergey-morenets
Copy link

For me as well. Gradle already claimed support for JDK 21 (if you use Gradle 8.4 and Groovy scripts).

So is JDK 21 fully supported for using build.gradle groovy setup? If this is true, can't be the plain JDK 21 image be published and be used for projects using groovy setup?

Not that I've seen. If someone can point to somewhere Gradle has stated this, I'll publish the 21 images.

Here's notes from 8.4 official release:

Gradle now supports [using Java 21](https://docs.gradle.org/8.4/userguide/compatibility.html#java) for compiling, testing, and starting other Java programs. This can be accomplished using [toolchains](https://docs.gradle.org/8.4/userguide/toolchains.html).

Currently, you cannot run Gradle on Java 21 because Kotlin lacks support for JDK 21. However, support for running Gradle with Java 21 is expected in future versions.

So I couldn't find anything about impossibility to build apps using Groovy scripts.
FYI, I tested locally Gradle 8.4, JDK 21 and app with Kotlin build scripts and build was successful.

@keeganwitt
Copy link
Owner

keeganwitt commented Oct 12, 2023

For me as well. Gradle already claimed support for JDK 21 (if you use Gradle 8.4 and Groovy scripts).

So is JDK 21 fully supported for using build.gradle groovy setup? If this is true, can't be the plain JDK 21 image be published and be used for projects using groovy setup?

Not that I've seen. If someone can point to somewhere Gradle has stated this, I'll publish the 21 images.

Here's notes from 8.4 official release:

Gradle now supports [using Java 21](https://docs.gradle.org/8.4/userguide/compatibility.html#java) for compiling, testing, and starting other Java programs. This can be accomplished using [toolchains](https://docs.gradle.org/8.4/userguide/toolchains.html).

Currently, you cannot run Gradle on Java 21 because Kotlin lacks support for JDK 21. However, support for running Gradle with Java 21 is expected in future versions.

So I couldn't find anything about impossibility to build apps using Groovy scripts. FYI, I tested locally Gradle 8.4, JDK 21 and app with Kotlin build scripts and build was successful.

I thought it meant because Gradle itself depends on Kotlin, they aren't able to make Gradle itself support Java 21 until Kotlin does. At least that seemed to be the consensus in the issue about Java 20. But looking at gradle/gradle#25777, it looks like they just bumped the asm version and I don't understand why that alone would break the ability to run Gradle on a newer JVM.

Edit: gradle/gradle#25574 (comment) confirms from a Gradle employee that as long as you're not using Kotlin build scripts, it's supposed to work.

Silly question from me, but as far as we're using Groovy DSL only, isn't possible to deactivate the kotlin part and run 8.3 on JDK21?

In theory this should work without any changes to Gradle, i.e. as long as you don't have any Kotlin buildscripts, it should work as-is.

@sergey-morenets
Copy link

So will you push new Docker image ?

@keeganwitt
Copy link
Owner

So will you push new Docker image ?

I'm doing some experimenting first. Gradle has stated that Kotlin scripts don't work with 21, but in my testing, it has worked. So, I'm confused what the limitations actually are.

@keeganwitt
Copy link
Owner

Here's the Java 21 Gradle issue: gradle/gradle#25574
There's also one for Java 22: gradle/gradle#26162
My understanding is https://youtrack.jetbrains.com/issue/KT-58987 should prevent this in the future (starting with Kotlin 1.9.20 once Gradle upgrades to that).

@keeganwitt
Copy link
Owner

Ah, it's usages of the kotlin-dsl plugin that don't work, as demonstrated in #266. I think as long as we document clearly what the limitations are, it's OK to publish the 21 images.

@keeganwitt
Copy link
Owner

Official images PR: docker-library/official-images#15537

@sergey-morenets
Copy link

@keeganwitt Thank you a lot

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

No branches or pull requests

4 participants