Eclipse: fully remove an old project?

南楼画角 提交于 2019-12-19 05:05:09

问题


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?


回答1:


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




回答2:


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




回答3:


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.




回答4:


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.




回答5:


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.




回答6:


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




回答7:


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.




回答8:


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




回答9:


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



来源:https://stackoverflow.com/questions/9045609/eclipse-fully-remove-an-old-project

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!