Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Class has been compiled by a more recent version of the Java Environment

While running Selenium script, I am getting the following error message in the Eclipse console:

Class has been compiled by a more recent version of the Java Environment (class file version 53.0), this version of the Java Runtime only recognizes class file versions up to 52.0.


  • Java Version: 8
  • IDE: Eclipse Oxygen
  • Firefox Version: 46
like image 615
user5218071 Avatar asked Oct 17 '22 13:10

user5218071


People also ask

What is the latest version of Java compiler?

Java 18 General Availability began on March 22, 2022, and for Java 17, the latest (3rd) LTS on September 14, 2021. Java 19 is in development with early-access builds already available.

How do I fix Java Lang UnsupportedClassVersionError in Java?

UnsupportedClassVersionError happens because of a higher JDK during compile time and lower JDK during runtime. How can i make above change? Project -> Properties -> Java Compiler Enable project specific settings. Then select Compiler Compliance Level to 1.7, 1.6 or 1.5, build and test your app.

When my class encounter UnsupportedClassVersionError which option would resolve this issue?

1) If you encounter UnSupportedClassVersionError, check the JRE version you are using to run program and switch to higher version for quick solution.


1 Answers

This is just a version mismatch. You have compiled your code using java version 9 and your current JRE is version 8. Try upgrading your JRE to 9.

49 = Java 5
50 = Java 6
51 = Java 7
52 = Java 8
53 = Java 9
54 = Java 10
55 = Java 11
56 = Java 12
57 = Java 13
58 = Java 14
59 = Java 15
60 = Java 16
61 = Java 17
62 = Java 18
63 = Java 19
like image 352
Nithin Avatar answered Oct 19 '22 01:10

Nithin