Skip to Main Content

New to Java

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Exception in thread "main" java.lang.UnsupportedClassVersionError

807600Oct 27 2007 — edited Oct 27 2007
Hi,

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

Comments

ateeqrahman
Answer

Solved.

Marked as Answer by ateeqrahman · Oct 26 2021
1 - 1
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Nov 24 2007
Added on Oct 27 2007
12 comments
1,116 views