2

When i try to compile my GWT application i'm getting below exception. Any idea ? Thanks in advance.

Loading inherited module 'widgets.PresentationWidgets'
   [ERROR] Unexpected error while processing XML
java.lang.UnsupportedClassVersionError: gwt/widgets/server/datagrid/util/WrapperGenerator : Unsupported major.minor version 51.0
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClassCond(ClassLoader.java:632)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:616)
    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
    at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
    at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
Dilantha
  • 1,552
  • 2
  • 30
  • 46
  • 1
    You are trying to run a jar compiled with JDK 1.7 on a 1.6 or less JVM – fge Feb 18 '14 at 09:57
  • May be you are using jars compiled with lower version of yours. Check the jar class java version. – Rahul Feb 18 '14 at 09:57
  • You will find your answer hre: http://stackoverflow.com/questions/10382929/unsupported-major-minor-version-51-0 Possibly this question is a duplicate. [1]: – dstronczak Feb 18 '14 at 09:59
  • Im getting this error when i trying to compile the GWT application. Not when running the application. – Dilantha Feb 18 '14 at 10:03
  • Right, your GWT compiler is running with JDK 1.6, but one of the jars on your classpath was compiled (at least in part) with JDK 1.7. – Colin Alworth Feb 18 '14 at 19:44

1 Answers1

2

clearly, your Java runtime evnironment is different from that of compile time version

For me this solved the problem: I have a 64-bit system with jdk1.7 (32bit) and jdk1.6 (64 bit) installed. Even though I had specified PATH and JAVA_HOME for jdk1.7, my java -version was 1.6

  • I removed the folder in which jdk1.6 was installed

. The problem was gone. Apparently, a 64 bit system gave preference to jdk1.6(64bit) instead of jdk1.7(32bit)

For more info, refer: How to fix java.lang.UnsupportedClassVersionError: Unsupported major.minor version

Community
  • 1
  • 1
gnsb
  • 327
  • 3
  • 8
  • 18