1 Error description
Run the program correctly, and quote the following error:
2 Error Reason
By observing the description of the error described above, we can know:
java.lang.UnsupportedClassVersionError:Unsupported Major.minor version 51.0
This error is: class version error is not supported.
In other words, different JDK versions of the class file can also be a difference, and some high version of the JDK can be compatible with the lower version of the JDK naturally no problem, but the contrary will be a problem.
In addition, java.lang.UnsupportedClassVersionError errors may occur in the Maven project, as well as an unrecognized error due to a different version. However, the reason for this error in the MAVEN project may be the cause of the different versions of MAVEN and the versions of the different Java jdk, for example, the version of Maven 3.3.1+ can only run on the Java JDK 1.7+ version. 3 Resolution Method
Check the project SDK and the JRE used by the runtime, found to be using the 1.6 version, but fortunately before the local also installed JDK 1.8 version, both are better than JDK 1.8 version, this error resolution. Of course, if it is a MAVEN project, you may also try to update the version of MAVEN.
References: causes and solutions for java.lang.UnsupportedClassVersionError errors