Is there a reason Gradle can't support JVM 24 on t...
# gradle
s
Is there a reason Gradle can't support JVM 24 on the day it drops to stable? Candidly I'm surprised more users are not upset about not being able to use JVM 24. Even if bytecode features at that tier are not supported yet by Kotlin's backend, having enum entries for future versions of Java makes sense, and would alleviate pressure to ship Kotlin Gradle Plugin updates in sync with releases. It used to be that JVM tier could be set by
Int
or
String
. Now we have (I think) no less than three enums and also a loss in functionality. How can that be possible? Surely there has to be a strong reason behind that.
h
Gradle itself does not support JVM 24 due to ASM, that requires a stable JVM 24 release.
s
Yes, I'm following the release notes, but Gradle doesn't need to run under JDK 24 to build JDK 24 projects. There is a Release Candidate of Gradle out as well. It mentions needing to wait on Groovy to unblock full JDK 24 support. But this question is specifically about the Kotlin Gradle Plugin.
For awhile, I remember "future" versions of Java being available in the enum, and producing warnings if selected (but not supported). KGP would max to the highest supported tier and issue a warning. If that were the case, though, why withhold the enum values? It just doesn't make sense to me.
(Maybe I am misremembering how that worked, actually, I'm not sure. But there has to be a reason, I would think, for the change from primitives, and then also a reason for not adding future JVM versions to the DSL enum.)
t
AFAIK you should be able to use JDK toolchain with version 24 to compile your code. As for Kotlin -
JvmTarget.JVM_24
should be available in Kotlin 2.2.0 release.
👍 1
h
Yes, but there is no toolchain support for JVM 24 too.
🤔 1
t
I've just tried with Gradle 8.13 and successfully configured and used JDK 24 toolchain
s
Toolchains actually work for us up to JDK 25 EA
Thank you @tapchicoma. Looking forward to 2.2.x. I know 2.1.x stable is on the way soon 🤞
h
Oh okay, release notes 8.13 mentions no support, but 8.14 supports 24 in toolchains.
732 Views