javaspringtomcatmyeclipse

Unsupported major.minor version 51.0 error after moving from IntelliJ IDEA JBoss to MyEclipse Tomcat


I am getting a Unsupported major.minor version 51.0 error after moving from IntelliJ IDEA JBoss to MyEclipse Tomcat.

Everything was working great under IntelliJ IDEA and JBoss and now we are moving to MyEclipse and Tomcat 6..

I am getting:

Unsupported major.minor version 51.0
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:615)
    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141

can someone please tell me how to fix this issue


Solution

  • This happens when you compile the code in a higher version of the JDK than you are using at runtime.

    You can set the compiler version here:

    Project -> Properties -> Java Compiler