Java 在项目的构建路径中检测到一个循环... eclipse

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/23546925/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-13 23:47:46  来源:igfitidea点击:

A cycle was detected in the build path of project ... eclipse

javaeclipse

提问by user648244

Just started using eclipse and I am getting the following error : A cycle was detected in the build path of project . The cycle consists of projects {x,y}.

刚开始使用 eclipse,我收到以下错误:在项目的构建路径中检测到一个循环。该周期由项目 {x,y} 组成。

How can i fix this? I have not done anything different, was trying to add maven dependencies when the error popped up. Have removed the decency but it still shows. Have tried to clean/build in maven, clean and restart my eclipse.

我怎样才能解决这个问题?我没有做任何不同的事情,当错误弹出时试图添加 maven 依赖项。已经删除了体面,但它仍然显示。尝试在 Maven 中清理/构建,清理并重新启动我的 Eclipse。

Any suggestions? been spending hours trying to fix this

有什么建议?花了几个小时试图解决这个问题

采纳答案by user3294068

Move code. It's your only option. You need to identify code in x that depends on y or code in y that depends on x. If you can move the code to the other project, that might fix the problem. Otherwise, you may need to move code to a new project. I've had to do both.

移动代码。这是你唯一的选择。您需要确定 x 中依赖于 y 的代码或 y 中依赖于 x 的代码。如果您可以将代码移动到其他项目,则可能会解决问题。否则,您可能需要将代码移动到新项目。我不得不两者都做。

回答by rdj7

You can adjust preferences to handle these dependencies, it would give you a WARNING Preferences > Java > Compiler > Building > Build path problems > Circular dependencies

您可以调整首选项来处理这些依赖项,它会给您一个警告 Preferences > Java > Compiler > Building > Build path problems > Circular dependencies

This worked for me atleast ! Hope it works for you.

这至少对我有用!希望对你有效。