由于这个问题,我卸载了 Eclipse IDE。然后我尝试在我的 Linux mint 终端中运行 java 程序。所以我从一个小代码开始
public class Myth{
public static void main(String[]args){
System.out.println("Hii There");
}
}
并通过给出命令来运行它,javac Myth.java
但java Myth
不给出输出它给出了以下错误
Error: A JNI error has occurred, please check your installation and try again
Exception in thread "main" java.lang.UnsupportedClassVersionError: JVMCFRE003 bad major version; class=Myth, offset=6
at java.lang.ClassLoader.defineClassImpl(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:379)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:154)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:729)
at java.net.URLClassLoader.access$400(URLClassLoader.java:95)
at java.net.URLClassLoader$ClassFinder.run(URLClassLoader.java:1184)
at java.security.AccessController.doPrivileged(AccessController.java:732)
at java.net.URLClassLoader.findClass(URLClassLoader.java:604)
at java.lang.ClassLoader.loadClassHelper(ClassLoader.java:926)
at java.lang.ClassLoader.loadClass(ClassLoader.java:871)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:343)
at java.lang.ClassLoader.loadClass(ClassLoader.java:854)
at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:507)