tags:

views:

118

answers:

2
+1  Q: 

Cycle in Eclipse

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 to 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.

+4  A: 

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.

Jeff Storey
yes i understand that, but shouldn't this be in the responsible of the programmer?
Roflcoptr
yes, but this sort of dependency can't be resolved by eclipse compiler.
Jeff Storey
A: 

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.

javilaureano
thanks a lot, ill try this. yes its not a optimal solution, but in my android project i don't see a way to avoid this
Roflcoptr