ChatGPT解决这个技术问题 Extra ChatGPT

How to delete a workspace in Eclipse?

How to delete a workspace in Eclipse?

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.
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.

J
Jess

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).


+1 and it helps to close Eclipse before editing the prefs file.
+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.
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...
@b1nary: If you've got one workspace embedded within another, I think you've got bigger problems. I'd strongly advise avoiding that.
@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.
R
ROMANIA_engineer

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.


I found that the workspace disappears from the "File -> Switch Workspace" list the next time you open Eclipse.
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 ;-)
Just a note, this option was introduced in Eclipse version 3.5 or 3.6
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
note that Preferences is under Window on the menu bar
b
bananaaus

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.


R
Raman Sahasi

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.

https://i.stack.imgur.com/q4CFG.png

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


+1 as this describes the place where I expected the setting to be, but since it's displayed as a link I didn't even thought of maybe right-clicking it
M
Mohammed Réda OUASSINI

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.


same answer with bananaaus
This helps me for eclipse Neon
D
Demetra

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