Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Eclipse rename not working completely

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.

like image 841
daveb Avatar asked Nov 14 '22 14:11

daveb


1 Answers

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.

like image 51
Miguel Ping Avatar answered Dec 23 '22 09:12

Miguel Ping