Unsupported class file major version 67

As soon as Gradle finish init I got this problem in VSC

The supplied phased action failed with an exception.
Build completed with 1 failures.
BUG! exception in phase 'semantic analysis' in source unit '_BuildScript_' Unsupported class file major version 67
Unsupported class file major version 67

I’m using the command

gradle init --type java-application --java-version 23 --project-name Name --dsl groovy --split-project --incubating --no-comments

java version: 23.0.1
gradle version: 8.12

You are most likely not using the Gradle version you think you are using but instead one that is not compatible with Java 23.

How do I verify it properly?

Use --version with the invocation.

------------------------------------------------------------
Gradle 8.12
------------------------------------------------------------

Build time:    2024-12-20 15:46:53 UTC
Revision:      a3cacb207fec727859be9354c1937da2e59004c1

Kotlin:        2.0.21
Groovy:        3.0.22
Ant:           Apache Ant(TM) version 1.10.15 compiled on August 25 2024
Launcher JVM:  23.0.1 (Oracle Corporation 23.0.1+11-39)
Daemon JVM:    C:\Program Files\Java\jdk-23 (no JDK specified, using current Java home)
OS:            Windows 10 10.0 amd64

Can you provide a build --scan URL of the failing run?

https://scans.gradle.com/s/ojfddlnjnkl4i

That’s a build scan of a successful invocation, not of the erroring build.

I noticed it too, so I just cleared the dir again and gradle init again with same configs. Now I got no problems at all. I did it at least 8 times before. I have no idea why this time it is all right.

Thank you for helping me.

1 Like