311

How to delete a workspace in Eclipse?

Elrond_EGLDer
  • 47,430
  • 25
  • 189
  • 180
Rahul
  • 12,392
  • 13
  • 55
  • 59
  • 8
    I know this seems like a simple question but the best way to pose it would have been to say what you did that didn't work (if anything), and why you're trying to do this. You might be asking the wrong question unknowingly and the more info you can provide, the better the answers you'll receive. – MattGrommes Feb 05 '09 at 14:30
  • 4
    Thanks Matt for your suggestion. I was not really facing any specific problem in deleting a workspace; I was just curious to know if there is a way to delete the workspace from within Eclipse. – Rahul Feb 06 '09 at 01:41

6 Answers6

449

Just delete the whole directory. This will delete all the projects but also the Eclipse cache and settings for the workspace. These are kept in the .metadata folder of an Eclipse workspace. Note that you can configure Eclipse to use project folders that are outside the workspace folder as well, so you may want to verify the location of each of the projects.

You can remove the workspace from the suggested workspaces by going into the General/Startup and Shutdown/Workspaces section of the preferences (via Preferences > General > Startup & Shudown > Workspaces > [Remove] ). Note that this does not remove the files itself. For old versions of Eclipse you will need to edit the org.eclipse.ui.ide.prefs file in the configuration/.settings directory under your installation directory (or in ~/.eclipse on Unix, IIRC).

Jess
  • 395
  • 1
  • 3
  • 15
Jon Skeet
  • 1,261,211
  • 792
  • 8,724
  • 8,929
  • 5
    +1 and it helps to close Eclipse before editing the prefs file. – rajah9 Feb 11 '11 at 17:07
  • 50
    +1 from me too for the accurate & details steps. I don't know when the `Windows` > `Preferences` > `General` > `Startup & Shudown` > `Workspaces` > `[Remove]` (button) was added either but I can confirm it exists on Indigo 3.7.2. – Withheld Dec 17 '12 at 14:51
  • One comment that needs to be made is that just deleting the directories will not work, Eclipse will remake them if you don't remove it from the General -> Startup & Shutdown -> Workspaces... – Andy Braham Oct 07 '13 at 00:28
  • 1
    @kgpdeveloper: Well you've still deleted the workspace, and the "remove from the list" is in the second paragraph. Did you follow that part as well? – Jon Skeet Feb 06 '14 at 11:23
  • I also had to edit: eclipse/configuration/config.ini osgi.instance.area=../myworkspace – user77115 Jun 13 '14 at 06:00
  • "Just delete the whole directory" ...sure, if you want to delete any other workspaces that might be contained in a sub directory, along with any files you might need. I think i'll just remove it from the preferences screen, considering that is what it's there for; and refer to a "how to delete a folder in windows" tutorial if I'm trying to accomplish that. – b1nary.atr0phy Aug 29 '14 at 19:11
  • 2
    @b1nary: If you've got one workspace embedded within another, I think you've got bigger problems. I'd strongly advise avoiding that. – Jon Skeet Aug 29 '14 at 19:27
  • @JonSkeet You're intentionally missing the point. If someone asks you how to delete fileXYZ, do you tell them to just wipe their entire drive? Of course not. Will it work? Of course! Does that make it good advice? No, because it's absurd. You're advising folks to delete any and all source, assets, etc. that they may or may not have backed up. Which is equally absurd. I think you should be more worried about the advice your handing out than with the composition of my workspace. – b1nary.atr0phy Sep 12 '14 at 21:49
  • 7
    @b1nary.atr0phy: I'm certainly not "intentionally missing the point" - please don't assume you know my thoughts. I'm assuming that the reader knows where their source is, and knows whether or not they've got it backed up. You are, of course, free to add your own answer. – Jon Skeet Sep 13 '14 at 06:09
  • could have been more explicit as in : https://surfdev.wordpress.com/2012/04/04/removing-an-unwanted-workspace-from-eclipse/ – KNU Aug 18 '15 at 19:29
  • 1
    The direct answer is the comment from @Withheld and it works in the latest eclipse Neon1 _Windows > Preferences > General > Startup & Shudown > Workspaces > [Remove]_ – Jess Oct 13 '16 at 15:28
278

It's possible to remove the workspace in Eclipse without much complications. The options are available under Preferences->General->Startup and Shutdown->Workspaces.

Note that this does not actually delete the files from the system, it simply removes it from the list of suggested workspaces. It changes the org.eclipse.ui.ide.prefs file in Jon's answer from within Eclipse.

Elrond_EGLDer
  • 47,430
  • 25
  • 189
  • 180
Equinox
  • 2,781
  • 1
  • 13
  • 2
  • I found that the workspace disappears from the "File -> Switch Workspace" list the next time you open Eclipse. – Jan Hettich Apr 24 '10 at 01:33
  • 34
    +1: While this doesn't actually delete the workspace, it gets rid of it from Eclipse's list of suggested workspaces, which is what I was looking for. – Powerlord Aug 06 '10 at 19:51
  • If you'd add that this does not cover deleting the contents of the workspace than you'd have a better, i.e. more up to date, answer than Jon Skeet! Now, how many people can say that ;-) – NomeN Feb 02 '11 at 12:22
  • 7
    Just a note, this option was introduced in Eclipse version 3.5 or 3.6 – Viktor Brešan Oct 17 '11 at 18:48
  • On OS X, the location of the file that is maintained by this setting is located in the application bundle itself. /Applications/Eclipse.app/Contents/Eclipse/configuration/.settings – jbruni Nov 03 '15 at 21:25
  • note that Preferences is under Window on the menu bar – Patrick Schaefer Feb 10 '16 at 22:16
38

For Eclipse PDT in Mac OS, once you have deleted the actual workspace directory the option to select and switch to that workspace will still be available unless you delete the entry from Preferences >> General >> Startup and Shutdown >> Workspaces.

bananaaus
  • 741
  • 1
  • 9
  • 10
12

I'm not sure about older versions, but from NEON onward, you can just right click on workspace and select Remove from launcher selection option.

Eclipse Neon - Remove Workspace

of course this won't remove the original files. It simply removes it from the list of suggested workspaces.

Raman Sahasi
  • 24,890
  • 6
  • 51
  • 66
10

Click on the menu Window > Preferences and go to Workspaces like below :

| General
    | Startup and Shutdown
        | Workspaces

Select the workspace to delete and click on the Remove button.

1

Just go to the \eclipse-java-helios-SR2-win32\eclipse\configuration.settings directory and change or remove org.eclipse.ui.ide.prefs file.

Demetra
  • 21
  • 6