Compiler version in Eclipse: Let eclipse understand Enum

Source: Internet
Author: User

There is always such a problem, that is, the newly downloaded Eclipse open a project with the enum keyword, there is always a situation where you do not know enum.

 

It is observed that the JRE system library of the project has already been set to 1.5 or 1.6. In theory, the enum keyword should be supported.

I was puzzled and found that the JRE configuration is actually used, not the compiler configuration.

The error check in eclipse is subject to the compiler settings:

On the windows-> preferences-> JAVA-> compiler tab, we can see the compilation Depth set in eclipse. If we do not set the depth to 5.0 or 6.0, there is no way to use the enum keyword.

After the modification is complete, rebuilt the entire project and the annoying little red XX disappears.

Generally, eclipse of Sb prefers to set it to 1.4 by default. I don't know why.

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.