Hi I am new to Java I am trying to get started in it but when I try to run my hello world script I run into this error. I have pumped this error into google and come back with a 7 year old stack overflow answer talking about versions that are compatible and what not. So I tried uninstalling and going back a version but then apparently I have to sign in and provide a company name in case of billing? I am not sure but either way I can't do that. So I reinstalled all of Java. This is what I have from a java-version:
java version "1.8.0_231"
Java(TM) SE Runtime Environment (build 1.8.0_231-b11)
Java HotSpot(TM) Client VM (build 25.231-b11, mixed mode)
After that I deleted the file I had compiled before and tried again. It seems to compile the file no issue but then when I try to run it I still get.
Error: A JNI error has occurred, please check your installation and try again
Exception in thread "main" java.lang.UnsupportedClassVersionError: MyClass 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 java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$100(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.launcher.LauncherHelper.checkAndLoadMain(Unknown Source)
If it makes a difference this is what my hello world statement looks like.
public class MyClass {
public static void main(String args[]) {
System.out.println("Hello World");
}
}
I did it just how the tutorial showed so I don't think that the issue is there but still im a noob so any help is greatly appreciated.