The error message "android requires compiler compliance level 5.0 or 6.0. Found '1. 7' instead" is displayed.

Source: Internet
Author: User

The error message "android requires compiler compliance level 5.0 or 6.0. Found '1. 7' instead. Please use Android tools> fix Project Properties" is displayed.

Solution:

1.ProjectRight-click and choose>Android tools->Fix Project

2. If not, checkProject->Properties->Java compiler

Confirm that compiler compliance level is set1.7AndEnable specific seetings.

After these two steps, the problem is basically solved.

Description of compiler compliance level in eclipse

Setting the compilation level is that eclipse compiler compliance level is a lower version, but it only makes the compiler believe that your code is compatible with a lower version, and the bytecode (class) generated during compilation is compatible with a lower version.

This setting has nothing to do with the JDK referenced when you write the code. That is to say, you can still reference a later version of the API when writing the code. (this may cause an error) set compiler compliance level to a lower version. The advantage is that when someone else uses a lower version of JDK, they can also reference your compiled code. It ensures the version consistency of the compiled class file. However, if your code (Java source) calls APIs of higher JDK versions. even if compiler compliance level is set to a lower version, running your code on a lower version of JDK will report an error.

Therefore, it is recommended that JDK referenced when writing code be consistent with the version set by compiler compliance level. Otherwise, the above error will be reported.

Related Article

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.