Exception in thread "main" java.lang.UnsupportedClassVersionError
807600Oct 27 2007 — edited Oct 27 2007Hi,
I'm new to Java and I've migrated from C# developing.
I'm using using both NetBeans and Eclipse to develop my java applications but I can't get them to run outside the IDE.
I will use the standard HelloWorld application to describe the problem.
Eclipse creates 2 files in the HelloWorld folder: src/HelloWorld.java and bin/HelloWorld.class
I tried from the commands prompt:
java HelloWorld.class
javaw HelloWorld.class
java HelloWorld
javaw HelloWorld
and it keeps replying with the same exception:
Exception in thread "main" java.lang.UnsupportedClassVersionError: HelloWorld (Unsupported major.minor version 50.0)
at java.lang.ClassLoader.defineClass0(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)
I have installed netbeans with JDK 6 update 3.
Please help me figure this out