I have a Groovy problem as I noticed something odd...
# community-support
h
I have a Groovy problem as I noticed something odd when upgrading one of our projects from Java 17 to Java 21, using Gradle 8.12.1. The compiled Java code will be on Java 21 level, but the compiled Groovy code will be fallbacked to Java 8 language level. If I set the targetCompatibility for GroovyCompile I can make the Groovy code be compiled on Java 17 language level (or any lower), but not any higher. Is this a know issue, or can I have missed something in my configuration? I add a small example project for you to see what I mean.
v
When building an MCVE, you should also remember to replace the `distributionUrl`in the wrapper properties away from an internal-only URL 😉
Btw. what is your concern with Groovy compilation producing Java 8 or Java 17 compatible class files?
Besides that, I guess Groovy 3.0.22 just does not support generating Java 21 class files and then falls back to Java 8. But that would more be a question for Groovy.
h
There is no other concern that we just want to be more up-to-date, and I have found no real problems due to this.
Then I know. Thanks.
👌 1