Class Has Been Compiled by a More Recent Version of Java Runtime

Shubham Vora Nov 15, 2022
  1. Java Version Numbers
  2. Resolve the Class Has Been Compiled by a More Recent Version of Java Runtime Error
Class Has Been Compiled by a More Recent Version of Java Runtime

The error message below shows the unsupported class version. It says the class file version is 63, and the current Java runtime can compiler the Java code until class file version 61.

Errors occur due to version mismatches, and we must update our Java runtime.

java class compiled by recent version - one

Java Version Numbers

Below, users can see the Java class file versions mapped to the JRE runtime versions.

Class File Version JRE Runtime Version
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

In our case, the class file version is 63, which means we should run the file using at least Java 19, but we are currently using Java 17. So, the simple solution is to upgrade the Java version to 19.

Resolve the Class Has Been Compiled by a More Recent Version of Java Runtime Error

Download and Install the Upgraded Java Version

Users should follow the below steps to upgrade the JDK version in Windows operating system.

  • Users can download the recent versions of Java from the official website of Oracle.
  • After that, users need to install the newer version of JDK by clicking on the downloaded file. Once the installation finishes, we have to edit the environment variables and update the path for the Java home directory.
  • To set environment variables, search for the environment variables on the windows search menu and click Edit System Environment Variables.

    java class compiled by recent version - two

  • Users can see the dialog box opened on the screen. Click on the Environment Variables from the bottom right corner.

    java class compiled by recent version - three

  • Find the JAVA_HOME in the System variables panel, edit it, and add the path of the upgraded JDK. If you don’t find JAVA_HOME, click on the new button and add it.

    java class compiled by recent version - four

  • Now, users can open the command prompt, execute the java -version command, and see the upgraded version of Java.

    java class compiled by recent version - five

  • Next, try re-compiling the Java code, which gave the error. You will be able to resolve it now.

Change the Java Version in Eclipse IDE

If users use any IDE, like Eclipse, to compile and execute the Java code, they also need to change the Java version of the IDE. To change the Java version in the Eclipse IDE, users can follow the steps in the article Change the Java version in Eclipse.

Now, users can also compile the Java class 63 file in Eclipse, and it will be executed without any error.

In this article, we have solved the version mismatch error by upgrading the version of JDK.

Author: Shubham Vora
Shubham Vora avatar Shubham Vora avatar

Shubham is a software developer interested in learning and writing about various technologies. He loves to help people by sharing vast knowledge about modern technologies via different platforms such as the DelftStack.com website.

LinkedIn GitHub

Related Article - Java Error