Gradle - unsupported class file
Unsupported class file major version xxjava {
toolchain {
languageVersion = JavaLanguageVersion.of(21)
}
}Last updated
Was this helpful?
When the Java toolchain version is not defined in the build.gradle, AutoFix might use the wrong Java version resulting in the following error:
Unsupported class file major version xxThis error can be solved by specifying the Java version in the build.gradle (or build.gradle.kts) file by adding:
java {
toolchain {
languageVersion = JavaLanguageVersion.of(21)
}
}Note: Make sure to replace 21 with the actual Java version your project requires.
Last updated
Was this helpful?
Was this helpful?