aspose file tools*
The moose likes Java in General and the fly likes Question on java.lang.UnsupportedClassVersionError Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Question on java.lang.UnsupportedClassVersionError" Watch "Question on java.lang.UnsupportedClassVersionError" New topic

Question on java.lang.UnsupportedClassVersionError

Mark Curlette
Ranch Hand

Joined: May 26, 2011
Posts: 46


I am struggling with the java.lang.UnsupportedClassVersionError error that I received from running my java program in IBM Websphere Rational Developer Edition version 7 and Websphere Application Server v7. I try to understand what does the error meant; so if you have any clue about what does the error mean, please let me know. I wonder if these errors related to the WAS or JRE given the fact that I am running on WAS 7 , RAD 7.5, and JRE v6 . Hope it help to shed some lights on figuring out what the error is.

The error is as follow :

java.lang.UnsupportedClassVersionError: org/eclipse/emf/ecore/resource/Resource$Factory$Registry (Unsupported major.minor version 49.0)
at java.lang.ClassLoader.defineClass0(Native Method)
at java.lang.ClassLoader.defineClass(
at Method)
at java.lang.ClassLoader.loadClass(
at sun.misc.Launcher$AppClassLoader.loadClass(
at java.lang.ClassLoader.loadClass(

Thanks in advance,

fred rosenberger
lowercase baba

Joined: Oct 02, 2003
Posts: 11314

I believe it means you have compiled with a newer version of java than you are running it on. So you may have compiled with Java 7, but your JRE is java 6.

There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
Mark Curlette
Ranch Hand

Joined: May 26, 2011
Posts: 46

Thank you so much Fred,
Yes, you are exactly right. I jjust checked and it turned out to be exactly what you said.
Since I am runiing on WAS 7 meaning I am compiling with Java 7 , right ? , and I check my java build path and I see Web Sphere V6 JRE.
Since I am new, please correct me if I am wrong. So based on what you were mentioning that I were compiling my program on WAS 7 but I ran it in v6 JRE ; therefore the error was caused by compiling on Java version 7 but running it onn JRE v6.

Thanks for your help, I am now understand it. One more question if you don't mind, since I am running on the JRE V6 , and compile my program on version 7 and now i want to get rid of the error then what should i do?

Please correect me if i am wrong. Could i import the Web Sphere V7 JRE into my java build path library in order to make it compatible with my WAS v7 ?

If it is the case, how could i import the Web Sphere V7 JRE into my java build path?

Thanks again for all of your help.

Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14150

The easiest solution is to use JDK 6 instead of JDK 7, if your program has to run on a Java 6 JRE.

Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
Rob Spoor

Joined: Oct 27, 2005
Posts: 19695

The 49.0 version indicates the class is compiled with Java 5.0 (Java 7 is 51.0), so you're not using Java 6 but Java 1.4 or below. Perhaps some older JRE nested itself in the PATH variable before your Java 6 JRE. Oracle database products are notorious for doing this.

How To Ask Questions How To Answer Questions
It is sorta covered in the JavaRanch Style Guide.
subject: Question on java.lang.UnsupportedClassVersionError