why enum could not be resolved in JAVA?

前端 未结 4 1425
忘掉有多难
忘掉有多难 2020-12-21 16:05

I was using J2EE Eclipse Indigo, and I have three class declare like this:

public interface ClassA {
   public static enum TYPE { TYPE1, TYPE2 };
}

public i         


        
4条回答
  •  心在旅途
    2020-12-21 17:03

    I had a similar problem:

    enum can't be resolved to a type

    Eclipse offered to import Enum instead.

    I went to

    • Preferences->Java->Installed_JREs->Execution_environment;
    • Selected JavaSE-1.6 in "Execution Environments" pane; and
    • Checked jre6 in Compatible JREs pane.

    After rebuild enum was recognized properly.

提交回复
热议问题