Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Eclipse - how to rename project folder (on filesystem)

My workspace filesystem folder is currently C:\work\Eclipse-Workspace_PROJ and my code filesystem folder is C:\work\PROJ.

I want to rename C:\work\PROJ to C:\work\PROJ-1 but last time I renamed it . . . bad things happened.

QUESTION

What are the steps to rename my code filesystem folder without corrupting things?

like image 438
Bob Avatar asked Feb 10 '17 20:02

Bob


People also ask

How do I rename a project folder?

Right-click on the project name & click reload the project. Then rename the project name as highlighted below & save. It will automatically rename the . csproj file.

How do I rename a project in Eclipse?

To rename the project, simply right-click the project and select "Refactor/Rename...". Fill in the new name and click OK.


2 Answers

You can use Move in the context menu of the Navigator view to move the project to a different folder. This will move the project to a different folder without renaming it.

I sometimes get an error message that the move failed, but the only thing I can see is that the root folder at the old project location is not deleted. After deleting it no further problems occurred (Eclipse Neon.1 / 4.6.1).

Note that the Move function in CDT's Project Explorer view cannot do this.

Since your projects are not inside the workspace directory, they are not at their default location. So renaming the project won't rename the folder.

like image 50
starblue Avatar answered Sep 28 '22 06:09

starblue


You should always rename things like Projects inside Eclipse using 'Refactor > Rename'.

There are many things in Eclipse that need to know about the rename, refactor will deal with updating them all.

If you are asking about renaming the Workspace folder then you do that outside of Eclipse (with Eclipse not running). Provided all the plug-ins you have installed in Eclipse are written correctly Eclipse should not care what the workspace folder is called.

Take a backup first if you are worried things may go wrong.

like image 23
greg-449 Avatar answered Sep 28 '22 08:09

greg-449