i've just upgraded java in my project to 17 version. When i'm trying to build it with gradle i'm facing this error
Execution failed for task ':project:bootJar'.
> Error while evaluating property 'mainClassName' of task ':project:bootJar'
> Unsupported class file major version 61
So , my main java conventions config has
java.sourceCompatibility = JavaVersion.VERSION_17
java.targetCompatibility = JavaVersion.VERSION_17
Also i set proper sdk to gradle config in IDEA, Gradle wrapper upgraded to 7.4
CodePudding user response:
Spring Boot 2.3 is not compatible with Java 17. Spring Boot 2.4 was the first version that is Java 17 compatible but it is no longer supported. At the time of writing, the supported versions of Spring Boot that are compatible with Java 17 are 2.6 and 2.7.