+ 1

Can somebody help me for the error in Java?

I have just installed Java and java program compiles with no error in CMD, (javac [className], gives no error) But while executing it says: 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=Firsttest, offset=6 at java.lang.ClassLoader.defineClassImpl(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:346) 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:686) at java.net.URLClassLoader.findClass(URLClassLoader.java:604) at java.lang.ClassLoader.loadClassHelper(ClassLoader.java:850) at java.lang.ClassLoader.loadClass(ClassLoader.java:829) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:325) at java.lang.ClassLoader.loadClass(ClassLoader.java:809) at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:507) Please help, will appreciate. I did some YouTube search but still could t fix. (I use windows 10 64bit)

13th Nov 2021, 9:13 AM
Coding San
Coding San - avatar
4 Réponses
+ 2
Do u using javafx swing ..... Awt i guess. i think u using these libraries without setup
13th Nov 2021, 9:21 AM
A S Raghuvanshi
A S Raghuvanshi - avatar
0
@Martin Taylor In C:\Program Files\Java its says jdk 17.0.1
15th Nov 2021, 3:52 AM
Coding San
Coding San - avatar