tags:

views:

101

answers:

4

Hi,

Eclipse is telling me:

a cycle was detected in the build path of -project name-

, although the structure of the project (created by others in the team) does not have cycles.
The same project is deployed on other machines (the same!) and it doesn't give the error.

I need to work from my machine so I need to solve this.
It is giving me the error in 8 different projects.
It was giving me the error in more (10 projects) but with cleaning and building 10 times just changed to 8! (without any changes in the code).

I really need to get this working and cleaning and building over and over is not doing anything. Any tips?

(note: this is not java, this is flex so i can't change the error to warning :))

Thanks a lot!

A: 

If it works on other machines but not your own, it must be a "local cache" effect.

You must have an existing library taken into account from a long time, which causes locally the error, while that same file is not present on the other workstations.

Could try and recreate the projects from scratch, on a new empty directory, and see if the problem persist?
If it does (and only then), the exact version of Eclipse and Flex plugin could help.

VonC
Is there anything before that? (Recreating the whole development environment is not an easy thing to do and is a last resort, I really appreciate the help but would like to see if there is anything to test before that) ((Unless you mean just recreating the projects which I tried))
@user220755: I understand recreating a full dev environment has a cost, but it is also a good way to improve the configuration of the project in order to reduce that cost. Is there anything to test before that? Maybe trying to remove all libraries in the existing projects, and then adding them one by one, starting with the most autonomous project (the one which doesn't have other projects in its project dependencies tab).
VonC
A: 

Try creating a new workspace then import the projects into that.

David Collie
tried it, didn't work :(
A: 

The problem most often arises after migrating your code. You have always been working on one project at a time, and all the time one of the projects was in a compiled state, so the builder didn’t complain. There is no law of nature that says that code shouldn’t be mutually dependent (it happens within projects all the time), but many builders, also in Eclipse, have problems with this chicken-egg problem and start complaining if both project’s are not compiled: “cycle detected in buildpath”. Often you’ll get the advise to adjust the severity level of circular dependencies to give only warnings (in Eclipse: Window > Preferences > Java > Compiler > Building > Build path Problems > Circular dependencies), but that’s no real solution. Make a component-diagram of your projects and their dependencies (I advise to use BOUML, freeware UML-editor, or Rational Rose), and imagine the builder working from right to left starting with nothing. If necessary, make a new project on the right and remove circularities between projects by moving definitions/interfaces that more projects should know of in there. (You could call this a leaf-project, needing nothing else, but the result is not necessarily a tree, it’s a net that you can traverse right to left).

Hans de Jong
A: 

Sorry for reposting. I saw that the text of my earlier answer was scrambled.


The problem most often arises after migrating your code. You have always been working on one project at a time, and all the time the other projects were in a compiled state, so the builder didn't complain. There is no law of nature that says that code shouldn't be mutually dependent (it happens within projects all the time), but many builders, also in Eclipse, have problems with this chicken-egg problem and start complaining if both projects are not compiled: "cycle detected in buildpath". Often you'll get the advise to adjust the severity level of circular dependencies to give only warnings (in Eclipse: Window > Preferences > Java > Compiler > Building > Build path Problems > Circular dependencies), but that's no real solution.

Make a component-diagram of your projects and their dependencies (I advise to use BOUML, freeware UML-editor, or Rational Rose), and imagine the builder working from right to left starting with nothing. If necessary, make a new project on the right and remove circularities between projects by moving definitions/interfaces that more projects should know of in there. (You could call this a leaf-project, needing nothing else, but the result is not necessarily a tree, it's a net that you can traverse right to left).

Hans de Jong