我编译了一个Java文件,并尝试使用javac
启动它,但是它不起作用。我试图将JDK更新到最新版本,但收到此错误:
Error: A JNI error has occurred, please check your installation and try again
Exception in thread "main" java.lang.UnsupportedClassVersionError: Main has
been compiled by a more recent version of the Java Runtime (class file version
56.0), this version of the Java Runtime only recognizes class file versions up
to 52.0
答案 0 :(得分:0)
当您调用Java时,我们将Java可执行文件的完整路径如下:
在Windows上:
C:\...\Java12\bin\java.exe my.class
在Linux上:
/opt/java12/bin/java my.class
根据您的环境调整路径。