UnsupportedClassVersionError: has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version (..)up to 52.0

We Are Going To Discuss About UnsupportedClassVersionError: has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version (..)up to 52.0. So lets Start this Java Article.

UnsupportedClassVersionError: has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version (..)up to 52.0

  1. UnsupportedClassVersionError: has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version (..)up to 52.0

    The real problem was, you built classes before by some upgraded version of JDK than what you currently have.
    I too faced a similar issue, which I solved in Eclipse by following steps:
    Project Properties (Alt + EnterKey) -> Java Build Path -> "Libraries" section ->

  2. UnsupportedClassVersionError: has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version (..)up to 52.0

    The real problem was, you built classes before by some upgraded version of JDK than what you currently have.
    I too faced a similar issue, which I solved in Eclipse by following steps:
    Project Properties (Alt + EnterKey) -> Java Build Path -> "Libraries" section ->

Solution 1

The real problem was, you built classes before by some upgraded version of JDK than what you currently have.

I too faced a similar issue, which I solved in Eclipse by following steps:

Project Properties (Alt + EnterKey) -> Java Build Path -> "Libraries" section -> 
classpath -> select "JRE System Library" -> Edit -> Execution environment from "JRE System Library" window ->
 Select the exact JDK version you currently have -> Apply -> Apply & Close.

Original Author Papai from BEKOAIL Of This Content

Solution 2

Can you try to add the below maven compiler plugin and check.

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-compiler-plugin</artifactId>
    <version>3.8.0</version>
    <configuration>
        <release>11</release>
    </configuration>
</plugin>

run the maven and build the jar and try to run.

Original Author Sambit Of This Content

Solution 3

I fixed by setting JAVA_HOME environment variable to point it to jdk12 directory on my machine.

Original Author Naveed I Of This Content

Solution 4

I had similar issues running mvn org.springframework.boot:spring-boot-maven-plugin:run on the command line. It turns out the plugin version was upgraded to something that no longer supports the version of java I was running ( java 11 ). Here is the ERROR I saw:

[ERROR] Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:3.0.0-M1:run (default-cli) on project PROJECT_NAME: Execution default-cli of goal org.springframework.boot:spring-boot-maven-plugin:3.0.0-M1:run failed: Unable to load the mojo 'run' in the plugin 'org.springframework.boot:spring-boot-maven-plugin:3.0.0-M1' due to an API incompatibility: org.codehaus.plexus.component.repository.exception.ComponentLookupException: org/springframework/boot/maven/RunMojo has been compiled by a more recent version of the Java Runtime (class file version 61.0), this version of the Java Runtime only recognizes class file versions up to 55.0

I was able to fix this by specifying the version in the command line mvn org.springframework.boot:spring-boot-maven-plugin:2.6.3:run ( notice :2.6.3 )

Original Author Scot Of This Content

Conclusion

So This is all About This Tutorial. Hope This Tutorial Helped You. Thank You.

Also Read,

Siddharth

I am an Information Technology Engineer. I have Completed my MCA And I have 4 Year Plus Experience, I am a web developer with knowledge of multiple back-end platforms Like PHP, Node.js, Python and frontend JavaScript frameworks Like Angular, React, and Vue.

Leave a Comment