Hello Guys, How are you all? Hope You all Are Fine. Today I just updated IntelliJ But I am facing following error Main has been compiled by a more recent version of the Java Runtime (class file version 57.0), this version of the Java Runtime only recognizes class file versions up to 52.0 in Java. So Here I am Explain to you all the possible solutions here.
Without wasting your time, Let’s start This Article to Solve This Error.
- How This Error Occurs ?
- How To Solve Main has been compiled by a more recent version of the Java Runtime (class file version 57.0), this version of the Java Runtime only recognizes class file versions up to 52.0 Error ?
- Solution 1: make this setting in IntelliJ IDEA
- Solution 2: select SDK default
- Solution 3: add environment PATH
- Summary
How This Error Occurs ?
I just updated IntelliJ But I am facing following error.
D:\MyProject\ProjectExcercise\src>java com.codewithmosh.Main
Error: A JNI error has occurred, please check your installation and try again
Exception in thread “main” java.lang.UnsupportedClassVersionError: com/ssc/Main has been compiled by a more recent version of the Java Runtime (class file version 57.0), this version of the Java Runtime only recognizes class file versions up to 52.0
at java.lang.ClassLoader.defineClass1(Native Method)
How To Solve Main has been compiled by a more recent version of the Java Runtime (class file version 57.0), this version of the Java Runtime only recognizes class file versions up to 52.0 Error ?
How To Solve Main has been compiled by a more recent version of the Java Runtime (class file version 57.0), this version of the Java Runtime only recognizes class file versions up to 52.0 Error ?
To Solve Main has been compiled by a more recent version of the Java Runtime (class file version 57.0), this version of the Java Runtime only recognizes class file versions up to 52.0 Error First of all Select File in your Intellij IDEA. Then select Settings. Select Build, Execution, Deployment. Now, Gradle. Then, Gradle JVM. Select eg. Project SDK (corretto-1.8) (or any other compatible version). Then delete the build directory and restart the IDE. Second Solution is You need to add
PATH
environment setting.C:\Program Files\Java\jdk-13
you currently have there is not correct. You just need to addbin
subdirectory for the latest JDK version at the top of thePATH
list.java.exe
executable is inC:\Program Files\Java\jdk-13\bin
directory, so that is what you need to have inPATH
. And your error will be solved.Main has been compiled by a more recent version of the Java Runtime (class file version 57.0), this version of the Java Runtime only recognizes class file versions up to 52.0
To Solve Main has been compiled by a more recent version of the Java Runtime (class file version 57.0), this version of the Java Runtime only recognizes class file versions up to 52.0 Error First of all Select File in your Intellij IDEA. Then select Settings. Select Build, Execution, Deployment. Now, Gradle. Then, Gradle JVM. Select eg. Project SDK (corretto-1.8) (or any other compatible version). Then delete the build directory and restart the IDE. Second Solution is You need to add
PATH
environment setting.C:\Program Files\Java\jdk-13
you currently have there is not correct. You just need to addbin
subdirectory for the latest JDK version at the top of thePATH
list.java.exe
executable is inC:\Program Files\Java\jdk-13\bin
directory, so that is what you need to have inPATH
. And your error will be solved.
Solution 1: make this setting in IntelliJ IDEA
- First of all Select
File
in your Intellij IDEA. - Then select
Settings
. - Select Build, Execution, Deployment.
- Now, Gradle.
- Then, Gradle JVM.
- Select eg.
Project SDK (corretto-1.8)
(or any other compatible version). - Then delete the
build
directory and restart the IDE.
Solution 2: select SDK default
- First of all Go to “Project Structure”.
- Then Select Project.
- Select Project language level.
- and select SDK default.
- This should use the same SDK for all project modules.
- Now, Your error should be solved.
Solution 3: add environment PATH
You need to add PATH
environment setting. C:\Program Files\Java\jdk-13
and you currently have there is not correct. You just need to add bin
subdirectory for the latest JDK version at the top of the PATH
list. java.exe
executable is in C:\Program Files\Java\jdk-13\bin
directory, so that is what you need to have in PATH
.
Add This in PATH variable.
C:\Program Files\Java\jdk-13\bin
Summary
It’s all About this issue. Hope all solution helped you a lot. Comment below Your thoughts and your queries. Also, Comment below which solution worked for you?
Also, Read