Java – meant by an “unbound” library or classpath container in Eclipse

classpatheclipsegroovyidejava

While recently imported a new project into eclipse, at one point when I tried to add the GROOVY_SUPPORT library it would up as "unbound" with error-X, like this:

GROOVY_SUPPORT library with red error-X

It also did not appear in the package explorer as I expected.

What precisely does this mean? Eclipse did not report any other errors. All I have it the red-X and the unbound message.

I was able to fix this via futzing with stuff (specifically removing and re-adding the Groovy nature) until it went away, but I'm curious about what was really going on.

Best Answer

Usually it means that the classpathentry in the .classpath can't be resolved. I usually see this when opening a project that was created/updated with a different plugin (or version) defining the classpath container that is unbound.

If you compare the .classpath file from when it was unbound to after the problem was fixed you should see the difference.

Fixing the problem the way you did (removing the unbound contain and re-adding it, as you did via the Groovy nature) is a simple way to fix the problem. One caveat, if you are part of a team working on the project and you get this problem then it would be a good idea to ensure all team members are on the same release of the IDE.