wood burning stoves 2.0*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes UnsupportedClassVersionError ?? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "UnsupportedClassVersionError ??" Watch "UnsupportedClassVersionError ??" New topic
Author

UnsupportedClassVersionError ??

Sunny Jain
Ranch Hand

Joined: Jul 23, 2007
Posts: 433

Hi Ranchers,

I am getting following exception while running a JAVA program, I dont know how to resolve this, Can any one give me some clue ?

C:\JAVA_PROG\source>java Hello1
Exception in thread "main" java.lang.UnsupportedClassVersionError: Hello1 (Unsup
ported major.minor version 49.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)

C:\JAVA_PROG\source>


Thanks and Regards,
SCJP 1.5 (90%), SCWCD 1.5 (85%), The Jovial Java, java.util.concurrent tutorial
Amit Ghorpade
Bartender

Joined: Jun 06, 2007
Posts: 2716
    
    6

Hi,
never heard of anything like this before but from my programming experience I
think that you have compiled the Heo1 file using a different JDK version and now you are executing it on a different one.

Also I think that this isn't the right forum for this question, anyways.




Hope this helps


SCJP, SCWCD.
|Asking Good Questions|
Stevi Deter
Ranch Hand

Joined: Mar 22, 2008
Posts: 265

Sunny,

Check out this topic.

Looks like your program was compiled with javac version 1.5, and you're trying to run it with an earlier version of java.


There will always be people who are ahead of the curve, and people who are behind the curve. But knowledge moves the curve. --Bill James
Deepak Bala
Bartender

Joined: Feb 24, 2006
Posts: 6661
    
    5

You compiled the source with a higher version of the JDK and you are trying to run it with a lower version.

Type java -version to check which version you are using to run the program.


SCJP 6 articles - SCJP 5/6 mock exams - More SCJP Mocks
pawni jain
Greenhorn

Joined: Apr 10, 2008
Posts: 22
hello,

may be this will work..
upgrade your JVM.uninstall all your java,then reinstall your JDKs and JREs, working from older to newer version.
Check which version you are using with.

Thanks,
Regards
Sunny Jain
Ranch Hand

Joined: Jul 23, 2007
Posts: 433

All right, thanks a lot to all.

I will do it now..!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: UnsupportedClassVersionError ??
 
Similar Threads
Newbie: Run-time error
No ClassDefFoundError
Why oh why do I even Try??
UnsupportedClassVersionError
while running junit it is throwing java.lang.Unsupported Class Version Error