开发者

Cycle in Eclipse

开发者 https://www.devze.com 2022-12-29 21:11 出处:网络
If I open two Java projects in Eclipse which depend on each other, I have to add dependencies between these two projects in the Build Path (Properties -> Java build path). This works fine for one way,

If I open two Java projects in Eclipse which depend on each other, I have to add dependencies between these two projects in the Build Path (Properties -> Java build path). This works fine for one way, but why doesn't allow Eclipse t开发者_如何转开发o set the dependencies vice versa? The following error message occurs:

A cycle was detected in the build path of project 'A'

and

A cycle was detected in the build path of project 'B'

I know what's causing this error but i wonder why exactly this isn't allowed. Thanks.


Well, if you need to have a cycle you can allow it by changing from error to warning in Window->Preferences->Java->Compiler->Building->Build path problems -> Circular dependencies.

But I still think that is a bad desing.


That type of circular reference can't be resolved. A needs B to run and B needs A to run. But having cycles between projects like this is a bad thing. If they both depend on each other, then they probably shouldn't be separate projects since they can't be deployed separately anyway.


Changing preference in Eclipse does not help in my case.

The best solution seems to combine two projects into one.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号