当我使用VSCode运行一个Java程序时,它总是显示由于类文件版本而无法识别编译的类文件的错误。
我检查了麦克的环境。javac -version和java -version显示了javac 1.8.0_181和java 1.8.0_181。
class Hello{
public static void main(String[] args) {
System.out.println("Hello World");
}
}如果我运行代码,它将显示错误:
Error: A JNI error has occurred, please check your installation and try again
Exception in thread "main" java.lang.UnsupportedClassVersionError: Hello has been compiled by a more recent version of the Java Runtime (class file version 56.65535), this version of the Java Runtime only recognizes class file versions up to 52.0https://stackoverflow.com/questions/55439574
复制相似问题