Reputation: 3340
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:
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.
Upvotes: 8
Views: 12670
Reputation: 15316
Encountered on Eclipse 4.5 Mars and GRECLIPSE 2.9.2
I had a few Groovy projects, imported before GRECLIPSE had been installed (but the Groovy compiler was on the path and GROOVY_HOME was set)
After GRECLIPSE installation, the projects wouldn't compile. So go to
Project Properties via Pulldown Menu > Java Build Path > Libraries > Add Library
And add "GROOVY SUPPORT" manually. The project compiles but:
This entry cannot be removed because this makes compilation impossible. So go to
Project Properties via Pulldown Menu > Groovy > Remove Groovy Nature
"Do you want to also remove the groovy runtime jars from project FOO?" YES
And circle around:
Project Properties via Pulldown Menu > Configure > Convert to Groovy Project
Everything compiles as before.
This changed the Libraries:
The content of ".classpath" has changed from:
<classpathentry exported="true" kind="con" path="GROOVY_DSL_SUPPORT"/>
<classpathentry kind="con" path="GROOVY_SUPPORT"/>
to
<classpathentry exported="true" kind="con" path="GROOVY_SUPPORT"/>
<classpathentry exported="true" kind="con" path="GROOVY_DSL_SUPPORT"/>
The content of ".project" has not changed.
<natures>
<nature>org.eclipse.jdt.groovy.core.groovyNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
Upvotes: 0
Reputation: 601
I just ran into this exact problem. It turns out I had not installed the Groovy Eclipse SDK features. Once I had them installed, GROOVY_SUPPORT was no longer unbound and everything worked.
Upvotes: 1
Reputation: 14045
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.
Upvotes: 3