• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Question on java.lang.UnsupportedClassVersionError

 
Mark Curlette
Ranch Hand
Posts: 46
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

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(ClassLoader.java:810)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:147)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:475)
at java.net.URLClassLoader.access$500(URLClassLoader.java:109)
at java.net.URLClassLoader$ClassFinder.run(URLClassLoader.java:848)
at java.security.AccessController.doPrivileged1(Native Method)
at java.security.AccessController.doPrivileged(AccessController.java:389)
at java.net.URLClassLoader.findClass(URLClassLoader.java:371)
at java.lang.ClassLoader.loadClass(ClassLoader.java:572)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:442)
at java.lang.ClassLoader.loadClass(ClassLoader.java:504)



Thanks in advance,

Minh
 
fred rosenberger
lowercase baba
Bartender
Pie
Posts: 12101
30
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Mark Curlette
Ranch Hand
Posts: 46
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.

Minh
 
Jesper de Jong
Java Cowboy
Saloon Keeper
Posts: 15216
36
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The easiest solution is to use JDK 6 instead of JDK 7, if your program has to run on a Java 6 JRE.
 
Rob Spoor
Sheriff
Pie
Posts: 20512
54
Chrome Eclipse IDE Java Windows
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic