Alexx
Alexx

Reputation: 3692

eclipse workspace: how to rename workspace

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!

Upvotes: 88

Views: 83232

Answers (8)

Annemarie Rinyu
Annemarie Rinyu

Reputation: 270

Under .metadata.plugins\org.eclipse.core.runtime.settings in your file location

Upvotes: 0

cb4
cb4

Reputation: 9383

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.

Upvotes: 0

Naju
Naju

Reputation: 31

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.

Upvotes: 3

Lord Henry Wotton
Lord Henry Wotton

Reputation: 1362

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.

Upvotes: 22

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)

Upvotes: 1

Sameh Ragheb
Sameh Ragheb

Reputation: 21

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.

Upvotes: 2

Saurabh Gokhale
Saurabh Gokhale

Reputation: 46425

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.

Upvotes: 61

Brent Worden
Brent Worden

Reputation: 10994

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.

Upvotes: 2

Related Questions