eclipse workspace: how to rename workspace

EclipseRenameWorkspace

Eclipse Problem Overview


There is no option in the file menu to rename a workspace. Is the recommended practice to close eclipse, rename the folder, and re-open? I worry about some potential dangling references in configuration files corrupting my workspace/projects...

Thanks!

Eclipse Solutions


Solution 1 - Eclipse

Source : Renaming a workspace?

> Yes, you can just rename the workspace > directory and/or move it. However, you > then have to tell Eclipse where the > new workspace is. In 3.1, you can use > 'switch workspace' to launch in a > different location (under the File > menu).
> > If you want to change it by hand, you > can edit the appropriate entries in > the files in the 'configuration' > directory where Eclipse is stored.
> You can change the > org.eclipse.ui.ide.prefs file to set > SHOW_WORKSPACE_SELECTION_DIALOG=true > if you want to be asked each time > Eclipse is run where the workspace is.

Solution 2 - Eclipse

For simple renaming, it is not necessary to switch workspaces, unless the workspace you want to rename is not the one currently active.

Anyway, you can rename the current open workspace by choosing Eclipse->Preferences->General->Workspace and changing the option "Workspace name (shown in window title)" from the default's workspace folder name to whatever you want to call it. Then, restart Eclipse.

Suppose your workspace's folder is "/foo/bar/workspace" and you never changed its name before; its name was then the default "workspace". After you renamed it to, say, "my_workspace" and restarted Eclipse, the Eclipse's window title should show: "my_workspace - (some stuff that varies) - /foo/bar/workspace".

Note that this is NOT going to modify the workspace folder's name. You may have to create a new folder with the desired name, switch to that folder (whose workspace will have the same name, by default) and import existing projects into it, as some have suggested here.

Solution 3 - Eclipse

Renaming Workspace folder worked for me. Close the eclipse, rename the workspace folder name, launch eclipse again. If you are using any project dependencies like user libraries,launchers etc, you have to relocate those to new location manually, from project build path.

Solution 4 - Eclipse

Copying workspace to a new folder works. Any reference Eclipse itself needs is resolved using the relative workspace location. If you have added launchers, substitution variables, etc. that rely on the absolute workspace location, they will need to be reset.

Solution 5 - Eclipse

John, I think in the original workspace you imported projects and that the projects depend on links not on being physically in the same location of the worspace (even thay are there already but the dependency is on links). If so you have to remove the projects from the new (copied) worspace and then re-import them again.

Solution 6 - Eclipse

I just did a:

File --> Import --> Maven --> Existing Maven Projects --> mention the new workspace location in "Root Directory" in the "Import Maven Projects" window

and it worked! All projects were imported properly.

BTW, I have Eclipse-Maven plugin "m2e" installed (http://wiki.eclipse.org/M2E_updatesite_and_gittags)

Solution 7 - Eclipse

2021 Update

In Eclipse 2020-12 (Windows 10), the "Workspace name (shown in window title)" preference mentioned in one answer is no longer there. Now, renaming a workspace (WS) requires a copy and delete operation.

Start by switch to another WS: File --> Switch Workspace --> select existing WS. Then rename the WS folder to desired new name. Switch to the new workspace folder and delete the old name:

  1. File --> Switch Workspace --> Other...
  2. Right-click old WS name --> Remove from launcher selection
  3. Click Browse --> select new workspace folder --> click Launch and Voila!

As mentioned in prior posts, depending on your setup some resource links may be broken. Delete the project without(!) removing it from disk, then import to new WS.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionAlexxView Question on Stackoverflow
Solution 1 - EclipseSaurabh GokhaleView Answer on Stackoverflow
Solution 2 - EclipseLord Henry WottonView Answer on Stackoverflow
Solution 3 - EclipseNajuView Answer on Stackoverflow
Solution 4 - EclipseBrent WordenView Answer on Stackoverflow
Solution 5 - EclipseSameh RaghebView Answer on Stackoverflow
Solution 6 - EclipseAmitava 'Ami' PalView Answer on Stackoverflow
Solution 7 - Eclipsecb4View Answer on Stackoverflow