Community
Participate
Working Groups
When adding a new Java project to my workspace the following is the path I give it: /home/andrew/java/project where "java" is a symlinked path. The "real" path is: /home/andrew/java-abc/project I do it this way, so I can point java to any branch of my code (where abc is the branch in this example) and just restart Eclipse for it to pull the sources from another branch. The problem is that eclipse adds the project as "/home/andrew/java-abc/project" even though I explicitly tell it to use "/home/andrew/java/project". The only work-around that I have found is to: cd ~/ delete java mv java-abc java eclipse (add project) close eclipse to make sure it saves the workspace mv java java-abc ln -snf java-abc java IMO, Eclipse should not rename folders when it is explicitly told to use a given path. BTW - this applies to: File>New>New Project>Java project>Create project from existing source
I'm not sure how the project from existing resources is created. Moving to JDT/UI to investigate.
We create the project in org.eclipse.jdt.internal.ui.wizards.buildpaths.BuildPathsBlock.createProject IProjectDescription desc= project.getWorkspace().newProjectDescription(project.getName()); desc.setLocationURI(locationURI); project.create(desc, monitor); With a locationURI like: file:/somewhere/java/project where java is the symlink
Not sure if it is possible at all with the symlink. Another workaround you may want to try is to use a linked source folder: 1. On your java project click right 2. Build Path>Link Source... 3. Provide the location of the branch you want to use 4. Provide a folder name 5. Finish Instead of a fixed location you can also define a variable pointing to the location. To switch the branch change the value of the variable on the General>Workspace>Linked Resources Preference Page. HTH
*** This bug has been marked as a duplicate of bug 233019 ***