why enum could not be resolved in JAVA? -
i using j2ee eclipse indigo, , have 3 class declare this:
public interface classa { public static enum type { type1, type2 }; } public interface classb extends classa { } public class classc implements classb { system.out.println(type.type1); }
there compilation error on type in classc. complain "enum cannot resolved type". , warning enum in classa, complain that:
multiple markers @ line - 'enum' should not used identifier, since reserved keyword source level 1.5 on - enum cannot resolved type - syntax error, insert ";" complete fielddeclaration
may know cause error in code?
i had similar problem:
enum can't resolved type
eclipse offered import enum
instead.
i went
- preferences->java->installed_jres->execution_environment;
- selected javase-1.6 in "execution environments" pane; ,
- checked jre6 in
compatible jres
pane.
after rebuild enum
recognized properly.
Comments
Post a Comment