gwtgwt-compilerunsupported-class-version

Unsupported major.minor version when doing GWT compile in eclipse


So I'm getting the following exception: I know that major.minor version exceptions come when you are compiling with an old jdk and running with a newer one but i'm just doing GWT compile. Can anyone shed some light on this:

Compiling module com.domkee.entities.Entities
[ERROR] Unexpected internal compiler error
java.lang.UnsupportedClassVersionError: com/domkee/entities/client/annontations/Table : Unsupported major.minor version 51.0
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:621)
    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
    at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
    at java.net.URLClassLoader.access$000(URLClassLoader.java:56)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
    at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:247)
    at com.google.gwt.dev.javac.TypeOracleMediator.getAnnotationClass(TypeOracleMediator.java:575)
    at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotation(TypeOracleMediator.java:643)
    at com.google.gwt.dev.javac.TypeOracleMediator.resolveAnnotations(TypeOracleMediator.java:663)
    at com.google.gwt.dev.javac.TypeOracleMediator.resolveClass(TypeOracleMediator.java:809)
    at com.google.gwt.dev.javac.TypeOracleMediator.addNewTypes(TypeOracleMediator.java:439)
    at com.google.gwt.dev.javac.TypeOracleMediatorFromSource.addNewUnits(TypeOracleMediatorFromSource.java:52)
    at com.google.gwt.dev.javac.CompilationState.assimilateUnits(CompilationState.java:164)
    at com.google.gwt.dev.javac.CompilationState.<init>(CompilationState.java:82)
    at com.google.gwt.dev.javac.CompilationStateBuilder.doBuildFrom(CompilationStateBuilder.java:450)
    at com.google.gwt.dev.javac.CompilationStateBuilder.buildFrom(CompilationStateBuilder.java:370)
    at com.google.gwt.dev.cfg.ModuleDef.getCompilationState(ModuleDef.java:360)
    at com.google.gwt.dev.Precompile.precompile(Precompile.java:252)
    at com.google.gwt.dev.Precompile.precompile(Precompile.java:233)
    at com.google.gwt.dev.Precompile.precompile(Precompile.java:145)
    at com.google.gwt.dev.Compiler.run(Compiler.java:232)
    at com.google.gwt.dev.Compiler.run(Compiler.java:198)
    at com.google.gwt.dev.Compiler$1.run(Compiler.java:170)
    at com.google.gwt.dev.CompileTaskRunner.doRun(CompileTaskRunner.java:88)
    at com.google.gwt.dev.CompileTaskRunner.runWithAppropriateLogger(CompileTaskRunner.java:82)
    at com.google.gwt.dev.Compiler.main(Compiler.java:177)

Solution

  • I didn't figure the problem, but I figured the solution:

    1. Close eclipse
    2. I uninstalled all the jdks (Apparently I had like 4)
    3. I installed a new one (java 1.6)
    4. Run eclipse
    5. set the compiler in window->preferences->java->compiler
    6. Projects can have an individually set compilers that is not the default workspace compiler so go through each project and right->click ->preferences -> java compiler and set a 1.6 compiler.