Unsupported Major.minor version 51.0 workaround

Source: Internet
Author: User
Tags unsupported

The project developed in Eclipse has a JDK that can be configured in the Java build path, and a Java compiler can be configured with compiler level, two of which are different, build The JDK version of path is what the compiler needs to use when you develop the code in Eclipse, to give you an indication of the error, the compile process, and the compiled version number in Java compiler compliance level, which is the function of After you have developed this project in the future, put it on the server and run the JDK version on that server. Colleague's problem is that the build path is configured with a Jdk,java of 1.7 compiler compliance Level is configured in the 1.7, but the server is 1.6 of the JDK, the error is reported that the compilation of the JDK (1.7) is higher than the JDK (1.6) used to run, this is wrong.
Summary: The JDK version of Build path is what the compiler needs to use when you develop it, for example, if you use JDK1.4, you cannot use generics. And the Java compiler compliance level is set by the Java code you have written, according to what JDK version is compiled, For example: Set is 1.4, the compiled class file can be run on more than 1.4 JRE, if the use of 5-level compilation, you can not run in the environment of 1.4, will be prompted version too high.
Supplement: After the example proves that when developing in eclipse, the JDK in Build path compiles the class library (that is, you use the class is not in this JDK), Java compiler compliance Level is a compilation of the syntax of the project (which is the correct syntax in your project), and in the process of development, these two places work. So, the safest thing to do is that build path and Java Complier compliance level and the JDK of the server configuration are all consistent and there is no problem.

Unsupported Major.minor version 51.0 workaround

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.