Can somebody help me for the error in Java? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 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( at at at$400( at$ at at at java.lang.ClassLoader.loadClassHelper( at java.lang.ClassLoader.loadClass( at sun.misc.Launcher$AppClassLoader.loadClass( at java.lang.ClassLoader.loadClass( at sun.launcher.LauncherHelper.checkAndLoadMain( 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
3 Answers
+ 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
@Martin Taylor In C:\Program Files\Java its says jdk 17.0.1
15th Nov 2021, 3:52 AM
Coding San
Coding San - avatar