Friday, October 16, 2009

Resolving the Exception in thread "main" java.lang.UnsupportedClassVersionError: com/google/gwt/dev/GWTCompiler(Unsupported major.minor version 48.0)

When I tried compiling my GWT project using TestProject-compile.cmd, I got the following exception:
Exception in thread "main" java.lang.UnsupportedClassVersionError:
com/google/gwt/dev/GWTCompiler (Unsupported major.minor version 48.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)



How To Resolve This?

Ensure that your JRE version in your environment variable in anything from Version 1.4 and above.
To check your Java version, pull up comman prompt and type in the following on the command line to check your JRE version:
java -version

Since I had Oracle installed, my "Path" environment variable was referencing 2 Oracle JVM's that were versions 1.1.3 and 1.1.8. I deleted these two paths and ensured that JVM path in the environment variable was pointing to the folder where I had installed Java 1.6.

This worked and did not cause the UnsupportedClassVersionError exception to be thrown anymore.

No comments:

Post a Comment

Thank you for your comment.