A quick solution to the Java enum keyword unrecognized _java

Source: Internet
Author: User

Copy from other people there myeclipse Java engineering, open a look marked red a large, careful look, it is not recognized enum keyword, this is a bit embarrassing.

I built a Java project myself and tested it, if I chose JavaSE-1.6 when I was building a new project:

is to identify the enum keyword, but if I choose the second or default jdk1.8, then I find that the Java compiler compliance The maximum limit in level is only 1.7, so the two solutions (the principle is the same), one is to compiler compliance Level is set to more than 1.5, and the other is to change the Org.eclipse.jdt.core under. Settings to the following:

Eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlinejsrbytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetplatform=1.6
org.eclipse.jdt.core.compiler.codegen.unusedLocal =preserve
org.eclipse.jdt.core.compiler.compliance=1.6
org.eclipse.jdt.core.compiler.debug.linenumber= Generate
org.eclipse.jdt.core.compiler.debug.localvariable=generate
Org.eclipse.jdt.core.compiler.debug.sourcefile=generate
Org.eclipse.jdt.core.compiler.problem.assertidentifier=error
Org.eclipse.jdt.core.compiler.problem.enumidentifier=error
org.eclipse.jdt.core.compiler.source=1.6

The above is a small series to introduce the Java enum keyword Unrecognized quick solution, I hope to help you, if you have any questions please give me a message, small series will promptly reply to everyone. Here also thank you very much for the cloud Habitat Community website support!

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.