I am getting this error, in my destination computer despite:
- My source and destination computer, both have the same version of Java installed- 1.6 26th update
- All files which I have compiled and run in the similar way run perfectly, except for this one- it is a Swing GUI for my application
- Plus I am not using any IDE, I am using plain notepad for editing
Why the UnsupportedClassVersionError despite the three constraints, and solution for it?
Note: the file is a simple GUI front end code which works perfectly on the source, which used simple libraries from AWT and SWING
Exception in thread "main" java.lang.UnsupportedClassVersionError: Bad version number in .class file
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.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 java.lang.ClassLoader.loadClassInternal(Unknown Source)