Thursday, April 21, 2011

Eclipse cannot resolve enum in the same namespace?

I've run accorss a really weird issue, in eclipse I've got a codebase I've been working on for a couple of weeks and it's working fine. I did an svn update and all of a sudden one of my classes doesn't compile because it can't resolve an enum which is in the same namespace to a type.

I've checked the Java version and I'm running under Java 6 so enums should be supported.

Also it worked up till yesterday and now it doesn't.

Has anyone else seen this kind of behaviour? I've reloaded eclipse but beyond that I dont know where to start diagnosing it.

From stackoverflow
  • Weird idea, but could it be that eclipse is trying to compile your class using a 1.4.2 compiler and isn't recognizing the enum?

  • If it does say "Step cannot be resolved to a type", just try and clean the project (Project -> Clean). Eclipse gets confused sometimes, and a clean usually helps.

  • I unloaded the project and reloaded it and it just works... No idea what the origianl issue was...

  • I had this recently. Turned out that someone had committed some jars that conflicted (had a previous build in) and put on the build path. Check recent commits to see if that's the problem, or to see what could have caused it.

    However I would definitely do a build clean first within Eclipse, and see if ANT/Maven is affected (you do have such build scripts I assume).

0 comments:

Post a Comment