我在使用 IntelliJ 时遇到了这个问题。但是我的系统上新安装的所有东西都是最新版本。
...已由更新版本的 Java Runtime(类文件版本 57.0)编译,此版本的 Java Runtime 仅识别最高 52.0 的类文件版本
我已经设置:
PATH 为 C:\Program Files\Java\jdk-13 JAVA_HOME 为:C:\Program Files\Java\jdk-13 JRE_HOME 为:C:\Program Files\Java\jre1.8.0_221
我已经设置了路径,试图在项目结构中找到变化
完整的错误信息:
H:\087-JAVA\HelloWorld\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/codewithmosh/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)
at …Run Code Online (Sandbox Code Playgroud)