views:

490

answers:

3

Ok I'm completely googled-out.

I have a few java projects in my eclipse workspace (about 25).   Most projects use linked source folders.

When I rename a class in Project1, the references to that class in the other projects are not updated. The references within the project are updated just fine.   The net result is compilation errors on the next automatic recompile.

I'm using Eclipse 3.5.1, but the same behavior was shown by 3.4.0 and 3.4.2

Any ideas about how to fix this?

My current plan - after googling for 20 minutes - is to write a script to convert the linked source folders to be OS links (I'm on linux) in the project folders themselves.   So then I'm no longer using linked source folders.

A: 

Cross-project renames work just fine if your projects depend on each other. What exactly do you mean with linked source folders: do you link to the same source folder more than once?

Philippe Faes
The project dependencies are correct. A linked source folder is a source folder that is not in your project, but located elsewhere. To see this, edit a project's build path, and then In the source tab you'll see a button to "Link Source". I have linked source folders in this way
daveb
A: 

This is a shot in the dark, but make sure that your project is a Java project. I am not sure if other project types (like the generic Project) might not refactor properly. I have never seen this problem before and it has always worked as expected for me...

PaulP1975
+1  A: 

Like Philippe Faes said, it works fine if your projects are set as a dependency on each other. Make sure that your project's build path are set up that way.

IMHO linked folders are for external files, not for another projects.

Another problem is that if you are just referencing a jar as a dependency (ie, on the project's class path), eclipse will not be able to know that the jar was build based on another project's source thus will not refactor properly.

Try to ask your colleagues for the eclipse project files (.project and .classpath) and edit the files if you need, then check if your refactor still doesn't work. I am guessing that your project is set up differently than your colleagues.

Miguel Ping