Java Eclipse:部分或全部项目无法导入,因为它们已存在于工作区中

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/23866413/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-14 08:41:05  来源:igfitidea点击:

Eclipse: Some or all projects can not be imported because they already exist in the workspace

javaeclipsegit

提问by Matthias

I'm sorry, I know that question is asked quite often. But non of the scenarios suits my problem.

对不起,我知道这个问题经常被问到。但没有一个场景适合我的问题。

I'm using Eclipse (in Win7) with Git. Within a Git-branch I created a new project. Then I switched back on the master-branch. There the project is not in the workspace. But when I want to add it, I get the following error:

我在 Git 中使用 Eclipse(在 Win7 中)。在 Git 分支中,我创建了一个新项目。然后我重新打开主分支。该项目不在工作区中。但是当我想添加它时,出现以下错误:

Some or all projects can not be imported because they already exist in the workspace

部分或全部项目无法导入,因为它们已存在于工作区中

My problem is, that the project is NOT in the workspace - as seen in Eclipse. But sure, it's on the hard disk, because it's part of my Git repository. So I can't delete it there. According to other posts, I removed it from this folder:

我的问题是,该项目不在工作区中 - 正如在 Eclipse 中看到的那样。但可以肯定的是,它在硬盘上,因为它是我 Git 存储库的一部分。所以我不能在那里删除它。根据其他帖子,我从这个文件夹中删除了它:

C:\Development\workspace.metadata.plugins\org.eclipse.core.resources.projects

C:\Development\workspace.metadata.plugins\org.eclipse.core.resources.projects

But still I can't re-add it to the Eclipse workspace. Any idea?

但是我仍然无法将它重新添加到 Eclipse 工作区。任何的想法?

采纳答案by Jens

Use "file" --> "import" -->"Existing Projects into Workspace" to import the Project that exists on your HDD

使用“file”-->“import”-->“Existing Projects into Workspace”来导入硬盘上存在的项目

回答by lopes

This usually happens when you change the project directory physically without first delete in Eclipse. You can view and delete these hidden projects in the following view:

这通常发生在您物理更改项目目录而没有先在 Eclipse 中删除时。您可以在以下视图中查看和删除这些隐藏的项目:

Window -> Show View -> Other -> Navigator

Then simply just continue with the process of import existing project.

然后只需继续导入现有项目的过程。

回答by Ortex

  1. Go to Window-> Perspective -> Open Perspective -> Java EE

  2. Right click on the desired project and remove it

  3. Go to File -> Import -> Existing Projects into Workspace

  1. Window-> Perspective -> Open Perspective -> Java EE

  2. 右键单击所需的项目并将其删除

  3. File -> Import -> Existing Projects into Workspace

回答by Danny

Window -> Show View -> Project Explorer

窗口 -> 显示视图 -> 项目资源管理器

After that, right click on the project name and Delete :)

之后,右键单击项目名称并删除:)

回答by borchvm

Verify that the project is created in the directory and that you are not filtering the projects by the Working Set.

验证项目是在目录中创建的,并且您没有按工作集过滤项目。

I hope this can help, I didn't realize that I was filtering through the Working Setand that's why I couldn't import the project, because it was already imported but I just didn't see it.

我希望这会有所帮助,我没有意识到我正在过滤工作集,这就是我无法导入项目的原因,因为它已经导入但我只是没有看到它。

enter image description here

在此处输入图片说明