Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Java > Java and JDK > Pro Java
|
Pro Java Expert level Java questions not about a specific book. Please indicate your version.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Pro Java section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 12th, 2007, 12:00 PM
Registered User
 
Join Date: Jun 2006
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default Compilation Error

Hi

I am using JDK6.When I am compiling program it compile successfully.But when I am trying to run (java myclass) it give me the following exception.

If anybody knows the solution for this than please help me.

Exception in thread "main" java.lang.UnsupportedClassVersionError: a (Unsupporte
d major.minor version 50.0)
        at java.lang.ClassLoader.defineClass0(Native Method)
        at java.lang.ClassLoader.defineClass(Unknown Source)
        at java.security.SecureClassLoader.defineClass(Unknow n 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)

Thanks

 
Old March 13th, 2007, 02:14 AM
Authorized User
 
Join Date: Mar 2007
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Default

i know the answer partially
java -ea classpath .filename this may solve ur problem

K.Mallikarjunarao
 
Old September 28th, 2007, 11:22 AM
Registered User
 
Join Date: Sep 2007
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

furqanms,

Your problem is a common one in the Java world. I myself had that problem when I was developing with Java for the first time. Anyway, it has been a long time since your post, but I'm replying here for the reference of other people who might come across. :)

The UnsupportedClassVersionError occurs when you re-compile your Java files without deleting the previous .class files. This does not happen always (because javac is supposed to update the .class files when the source files are updated) but this happens sometimes. If you delete all .class files and then recompile it, it will work.

Good Luck.

- Yohan.





Similar Threads
Thread Thread Starter Forum Replies Last Post
compilation error pratik28 C# 1 September 24th, 2006 07:39 AM
Compilation Error allyant ASP.NET 2.0 Basics 1 August 5th, 2006 05:51 PM
Compilation error Giri ASP.NET 1.0 and 1.1 Basics 3 August 3rd, 2005 04:14 PM
compilation error luizou Classic ASP Components 1 February 10th, 2005 06:25 PM
compilation error saint Classic ASP Databases 2 June 23rd, 2003 04:08 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.