某些项目无法导入,因为它们已存在于 Eclipse 中的工作区错误中

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/6715403/
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-09-10 20:18:27  来源:igfitidea点击:

Some projects cannot be imported because they already exist in the workspace error in Eclipse

eclipse

提问by Kelley Duran

I am trying to import a project that me and my co-worker have been working on.. and keep getting this error after I select-- "import" then "import existing project" then click archive file, and then I click next, and this error comes up:

我正在尝试导入我和我的同事一直在处理的项目..并在我选择后不断收到此错误 - “导入”然后“导入现有项目”然后单击存档文件,然后单击下一步,出现这个错误:

"Some projects cannot be imported because they already exist in the workspace"

“某些项目无法导入,因为它们已存在于工作区中”

回答by rekinyz

Uncheck the "copy projects into workspace"checkbox, and then click "refresh"button, you will be able to import the project

取消选中“将项目复制到工作区”复选框,然后单击“刷新”按钮,您将能够导入项目

回答by zishan

go to .project file in your project and change the name of the project in name tag

转到项目中的 .project 文件并在名称标签中更改项目的名称

回答by Pino

It has just happened to me too. Finally I realized that the project was already open in my workspace but it was not visible because of the selected working set. You have just to deselect the active working set and all opened projects will become visible.

它也刚刚发生在我身上。最后我意识到该项目已在我的工作区中打开,但由于选定的工作集而无法显示。您只需取消选择活动工作集,所有打开的项目都将变得可见。

回答by ArK

You may have a project with same name in your workspace. Try to refresh (file->refresh) your workspace after deleting the another one with same name. A typical situation occurs when you want to re-import a deleted project.

您的工作区中可能有一个同名的项目。删除另一个同名的工作区后,尝试刷新(文件-> 刷新)您的工作区。当您要重新导入已删除的项目时,会发生典型情况。

回答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 -> General -> Navigator

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

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

回答by Vikram

In my case, I copied one of the projects (say 'Project1') from the workspace and pasted it to the same workspace. After that I modified the name of the pasted project (say to 'Project2'). I could not see it in the repository.

就我而言,我从工作区复制了其中一个项目(例如“Project1”)并将其粘贴到同一个工作区。之后我修改了粘贴项目的名称(比如“Project2”)。我在存储库中看不到它。

The main reason was .projectfile from the new project still had: <name>Project1</name>instead of <name>Project2</name>.

主要原因是.project来自新项目的文件仍然有: <name>Project1</name>而不是<name>Project2</name>.

So, I did following things in order to get the issue fixed:

所以,我做了以下事情来解决这个问题:

  1. Cut and paste Project2 outside the workspace
  2. Change .projectfile to have <name>Project2</name>
  3. Try importing Project2 again.
  1. 在工作区外剪切和粘贴 Project2
  2. .project文件更改为<name>Project2</name>
  3. 再次尝试导入 Project2。

It worked for me.

它对我有用。

回答by Tonny Madsen

Projects in the Eclipse workspace must be unique. Note though that the project name need not be the same as the directory/folder name of the project, so you can either delete any existing project with the same name or alternatively rename the existing projects.

Eclipse 工作区中的项目必须是唯一的。请注意,项目名称不必与项目的目录/文件夹名称相同,因此您可以删除任何具有相同名称的现有项目或重命名现有项目。

回答by barbas

You have one occult directory named ".metadata" in workspace directory. Close Eclipse, delete ".metadata" and open Eclipse. When eclipse ask you about workspace make sure that ".metadata" isn't in workspace directory and click "ok" button to select default workspace.

您在工作区目录中有一个名为“.metadata”的神秘目录。关闭 Eclipse,删除“.metadata”并打开 Eclipse。当 Eclipse 询问您有关工作区的信息时,请确保“.metadata”不在工作区目录中,然后单击“确定”按钮选择默认工作区。

回答by tyler

Maybe you get the same project name in your '.project' file,check it,if yes, rename another name.than import again

也许你在你的“.project”文件中得到了相同的项目名称,检查它,如果是,重命名另一个名称。然后再次导入

回答by ambicoder

If you've arrived at this because you have cloned a git project into the existing workspace and now you want to promote that workspace to a full fledged project then you should use the 'Git Repositories' view -> select 'Working Directory' -> Import Projects -> Existing projects.

如果你是因为已经将一个 git 项目克隆到现有工作区而到达这里,现在你想将该工作区提升为一个完整的项目,那么你应该使用“Git 存储库”视图 -> 选择“工作目录” ->导入项目 -> 现有项目。