Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

exception in thread "main" java.lang.unsupportedclassversionerror: has been compiled by a more recent version of the java runtime (class file version 55.0), this version of the java runtime only recognizes class file versions up to 52.0

Java 11 uses Class File Version 55
Java 8  uses Class File Version 52

This exception means that the java application or Java Class was compiled with Java 11 
where Source and Target both compatibility was Java 11.

So to resovle this issue, there are 2 solutions.

1 - Use Java 11 for compilation and for execution.
2 - When compiling change the Target Compatibility to Java 8. 
(This can be done in multiple ways.)
	a) Command:     javac -source 11 -target 8 
    b) Maven:  <maven.compiler.target>1.8</maven.compiler.target>
    c) Eclipse: Right Click on Project -> Properties -> Java Compiler -> Java Complience Level (Change to 1.8) 
    D) Intellij: File -> Project Structure -> Project -> Language Level (Change to 1.8)
 
PREVIOUS NEXT
Tagged: #exception #thread #compiled #version #java #runtime #file #version #version #java #runtime #recognizes #class #file #versions
ADD COMMENT
Topic
Name
7+1 =