Hi,

since I just got that mail with JDK21 coming along I thought I try to
run Groovy with it - fully expecting gradle to fail already. And of course

Caused by: BUG! exception in phase 'semantic analysis' in source unit
'./build-logic/src/main/groovy/org/apache/groovy/gradle/CheckstyleHtmlReport.groovy'
Unsupported class file major version 65

That is basically not surprising but I was wondering... why is it
actually the case? Should we not be able to compile with a target class
file version for the build?

From the home page for Gradle 8.1.1:
"""
With toolchain support added to GroovyCompile, it is possible to compile
Groovy code using a different Java version than the one running Gradle.
If you also have Java source files, this will also configure JavaCompile
to use the right Java compiler is used, as can be seen in the Java
plugin documentation.
"""

There is actually 2 things I would like to have. One is to be able to
use for example JDK21 for Groovy compilation, but with 16 (or something
we support) as target. And the other is to be able to additionally use a
different JDK version to run Gradle itself.

What do you guys think?

bye Jochen

Reply via email to