Bruno Girin
Bruno Girin

Reputation: 436

Eclipse: fully remove an old project?

I run eclipse on Ubuntu 11.10. I originally created a project in folder foo. I subsequently deleted that project to re-organise folders and I now want to create a new project in folder foo/bar but Eclipse won't let me because it says the the new directory is a sub-directory of an existing project.

How can I force Eclipse to forget about the original project so that I can create the new one?

Upvotes: 28

Views: 69714

Answers (10)

Jeff Silverman
Jeff Silverman

Reputation: 724

Instead of deleting any file, rename it, so if whatever you try doesn't work, you can revert.

Upvotes: 0

schmopinions
schmopinions

Reputation: 49

I have also encountered this problem, except it's been in Windows. I didn't want to completely remove the .metadata folder and none of the other solutions fixed it.

I managed to fix it by removing the file workspace\.metadata\.plugins\org.eclipse.core.resources\.safetable\org.eclipse.core.resources while Eclipse was closed. The file gets saved when closing Eclipse so I guess it is cached while Eclipse is open.

Upvotes: 4

Blank Chisui
Blank Chisui

Reputation: 1073

If the Project was in a working set before you deleted it, you might have to manually remove it from the set.

Upvotes: 1

Alécio Carvalho
Alécio Carvalho

Reputation: 13647

In general, the deleting the project from the "/.metadata/.plugins/org.eclipse.core.resources/.projects" should work, but if you're using 'working sets', you might have the problem I had once, which is basically have a 'ghost' project in your workspace that you can't delete because it says "this project doesn't exist anymore".

If this is your problem, try to delete an entry for your 'ghost project' in the file:

"/.metadata/.plugins/org.eclipse.ui.workbench/workingsets.xml" (on MacOS).

Upvotes: 50

ginger
ginger

Reputation: 21

I am running Eclipse Kepler on OS X Mountain Lion, and I had a similar problem. I deleted a project and tried to recreate it in the same location. Eclipse gave me an error saying that the project already existed. I discovered that if I close Eclipse after deleting a project, then reopen it, Eclipse finally 'forgets' the deleted project and allows me to re-create it.

(This question was posted over 1.5 years ago, and I'm guessing that Bruno already tried this and it didn't work. I just want to let others know that this solution worked for me now on Kepler.)

Upvotes: 2

kwang
kwang

Reputation: 11

maybe you can try to delete the folders: "/your_workspace/.metadata/.plugins/org.eclipse.core.resources" "/your_workspace/ProjectName"

Upvotes: 1

PetMarion
PetMarion

Reputation: 147

I had the same problem, with Egit and repositories that I deleted and imported back again, instead of importing as general project choose import as existing project.

Upvotes: 1

Kajal
Kajal

Reputation: 59

Delete the project from /.metadata/.plugins/org.eclipse.core.resources/.projects and not the whole .metadata folder will save all other projects and config.

Upvotes: 5

Bruno Girin
Bruno Girin

Reputation: 436

I finally managed to fix it by deleting the workspace/.metadata directory. This resolves the problem but has the side effect of making eclipse forget everything about the workspace so I'm not sure it's a recommended way of fixing the problem.

Upvotes: 2

Wojciech Owczarczyk
Wojciech Owczarczyk

Reputation: 5735

Go to your workspace folder using some file manager (you can find your workspace location, be clicking File -> Swich Workspace...) and delete your foo folder, or simple remove its contents (.project file being most important). Then you should be able to create your new project.

Upvotes: 2

Related Questions