How to fix Unsupported class file major version 57 in maven for Java 13 and Spring

Changing Spring boot version in the pom.xml solved this issue for me.

   <parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>2.2.0.RELEASE</version>
    <relativePath/> <!-- lookup parent from repository -->
   </parent>

The 2.2.0 version of spring-boot hasn't been released yet, but there is a milestone build (M4). If you want to use it, you need to add another maven repository to your pom.xml file:

<repositories>
    <repository> 
        <id>repository.spring.milestone</id> 
        <name>Spring Milestone Repository</name> 
        <url>http://repo.spring.io/milestone</url> 
    </repository>
</repositories>

You can then depend on the milestone build:

<parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>2.2.0.M4</version>
</parent>

See also: https://www.baeldung.com/spring-maven-repository


I accidentally upgraded my java before doing the:

./gradlew wrapper --gradle-version 6.2.2 --debug --stacktrace

This is the only surefire way I was able to upgrade to jdk13 and gradle 6.2.2. There might be a simpler less destructive way but this worked for me


To fix this I installed the latest gradle

brew install gradle

From root of project, move the existing build and settings to temp location

mv build.gradle build.gradle.old
mv settings.gradle settings.gradle.old

re init the gradle application and follow prompts

gradle init

move the build and settings back

mv build.gradle.old build.gradle
mv settings.gradle.old settings.gradle

rebuild your project