UnsupportedClassVersionError:

A

asit

I jave installed jdk and Net bean.
When I run the program in Net bean it runs poperly, but when I install
in command line using java command it shows the following error.

please help me to fix this !!!

Exception in thread "main" java.lang.UnsupportedClassVersionError:
Download (Uns
upported 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)
 
A

Arne Vajhøj

asit said:
I jave installed jdk and Net bean.
When I run the program in Net bean it runs poperly, but when I install
in command line using java command it shows the following error.

please help me to fix this !!!

Exception in thread "main" java.lang.UnsupportedClassVersionError:
Download (Unsupported major.minor version 50.0)
at java.lang.ClassLoader.defineClass0(Native Method)


You build with Java version X and you try to run with Java version Y
and X > Y.

Run it with the same Java version that you build with.

Arne
 
J

Joshua Cranmer

asit said:
I jave installed jdk and Net bean.
When I run the program in Net bean it runs poperly, but when I install
in command line using java command it shows the following error.

Short answer: make sure you're using the newest Java version available.
Try explicitly downloading and installing the Java 6 JRE from Sun's website.

Long answer: Your JDK and JRE versions are off. Specifically, the JDK is
JDK 6 (50.0 = Java 6 in terms of the actual file format version), and
your Java is at most Java 5, probably 4 or 5. I don't know what your
system looks like, so I'm extrapolating, but I guess that Netbeans comes
with a copy of JDK 6, so you never installed a version 6 JRE.

When Netbeans runs programs, it will use the JRE from the JDK
installation, but from the command line, it's the system search path
that rules. Since you're on Windows, it's probably using
C:\Windows\System32\java.exe for your command line work, which is
probably Java 5 and hence too old. For verification, you can run use the
-version flag to find the actual version.

Installing a new version will cause the various system entries to be
changed to point to a Java 6 installation.
 
Joined
Jun 9, 2009
Messages
5
Reaction score
0
jdk version issue

Check your system for existance of multiple jdk/jre's.

Keep only one version..

Raja Nagendra Kumar
C.T.O
tejasoft.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,969
Messages
2,570,161
Members
46,705
Latest member
Stefkari24

Latest Threads

Top