Home > Java > javaTutorial > How Do I Fix the 'Class Compiled with Higher Java Version than Runtime' Error in Eclipse?

How Do I Fix the 'Class Compiled with Higher Java Version than Runtime' Error in Eclipse?

Susan Sarandon
Release: 2024-11-12 16:09:02
Original
684 people have browsed it

How Do I Fix the

Error: Class Compiled with Higher Java Version than Runtime

When executing scripts in Eclipse, users may encounter an error stating "Class has been compiled by a more recent version of the Java Environment." This issue arises when the compiled code targets a Java version higher than the currently installed Java Runtime Environment (JRE).

To resolve this issue, it's essential to verify the Java version of the compiled code and the installed JRE. In the given case, the error message indicates that the code was compiled using Java 9, while the installed JRE is Java 8.

To correct this mismatch, upgrading the JRE to version 9 is recommended. The table below provides a mapping between class file versions and corresponding Java versions:

Class File Version Java Version
49 5
50 6
51 7
52 8
53 9
54 10
55 11
56 12
57 13
58 14
59 15
60 16
61 17
62 18
63 19
64 20
65 21

By upgrading the JRE to the appropriate version, the code will execute successfully without the mentioned error.

The above is the detailed content of How Do I Fix the 'Class Compiled with Higher Java Version than Runtime' Error in Eclipse?. For more information, please follow other related articles on the PHP Chinese website!

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Articles by Author
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template