javaeclipseunsupported-class-version

UnsupportedClassVersionError java


Possible Duplicate:
Exception in thread “main” java.lang.UnsupportedClassVersionError: a (Unsupporte d major.minor version 51.0)

I have been using Eclipse with jre 1.7.x and jdk 1.7.x before and I had to downgrade to 1.6x.

The way that I downgraded was to uninstall all the 1.7 related from my computer and install 1.6 again.

Now, when I try to debug, I am getting

`java.lang.UnsupportedClassVersionError: MyClass: Unsupported major.minor version 51.0`

I checked the version of JRE and JDK that used to compiled, both of them are 1.6.

Can anyone help with this?


Solution

  • java.lang.UnsupportedClassVersionError: `Unsupported major.minor version 51.0`
    

    Your runtime version is different from compile time version.

    Make sure JAVA_HOME variables etc., to make sure compile and runtime both pointing to same version.