“不受约束”是什么意思? Eclipse 中的库或类路径容器?
最近将一个新项目导入 eclipse 时,当我尝试添加 GROOVY_SUPPORT 库时,它会显示为“未绑定”并带有错误 -X,如下所示:
它也没有像我预期的那样出现在包资源管理器中。
这究竟意味着什么? Eclipse 没有报告任何其他错误。我只有红色 X 和未绑定的消息。
我能够通过一些东西(特别是删除并重新添加 Groovy 性质)来解决这个问题,直到它消失,但我很好奇到底发生了什么。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
通常这意味着.classpath中的classpathentry无法解析。我通常在打开使用定义未绑定的类路径容器的不同插件(或版本)创建/更新的项目时看到这种情况。
如果您将未绑定时的 .classpath 文件与问题解决后的 .classpath 文件进行比较,您应该会看到差异。
按照您的方式解决问题(删除未绑定的包含并重新添加它,就像您通过 Groovy 性质所做的那样)是解决问题的一种简单方法。需要注意的是,如果您是从事该项目的团队的一员并且遇到此问题,那么最好确保所有团队成员都使用同一版本的 IDE。
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.
我刚刚遇到了这个问题。原来我没有安装 Groovy Eclipse SDK 功能。一旦我安装了它们,GROOVY_SUPPORT 就不再是未绑定的并且一切正常。
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.
在 Eclipse 4.5 Mars 和 GRECLIPSE 2.9.2 上遇到
我有一些 Groovy 项目,在安装 GRECLIPSE 之前导入(但 Groovy 编译器在路径上并且设置了 GROOVY_HOME)。
安装 GRECLIPSE 后,这些项目无法编译。所以去
并手动添加“GROOVY SUPPORT”。该项目编译但是:
无法删除此条目,因为这会使编译变得不可能。所以去
然后绕圈:
一切都像以前一样编译。
这更改了库:
“.classpath”的内容已从: 更改
为
“.project”的内容未更改。
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
And add "GROOVY SUPPORT" manually. The project compiles but:
This entry cannot be removed because this makes compilation impossible. So go to
And circle around:
Everything compiles as before.
This changed the Libraries:
The content of ".classpath" has changed from:
to
The content of ".project" has not changed.