Causes of Java.lang.UnsupportedClassVersionError errors and Solutions __JDK

Source: Internet
Author: User
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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.