Eclipse导入项目错误,重叠工作区位置。

时间:2021-08-16 10:33:38

I have a big project that I want to import to Eclipse, but everytime I do that I get:

我有一个大项目想要导入到Eclipse中,但是每次我都得到:

Invalid project description.
  D:\svn\myproject\vr overlaps the workspace location: D:\svn\myproject\vr

I also reinstalled Eclipse, then set my workspace to where the program exists and then I choose to import the project and always get this error.

我还重新安装了Eclipse,然后将我的工作空间设置为程序存在的地方,然后我选择导入项目并始终得到这个错误。

Anyone has a solution for this? Am I doing something wrong?

有人能解决这个问题吗?我做错什么了吗?

Thanks.

谢谢。

8 个解决方案

#1


33  

Use another EMPTY (thus clean) directory for your clean workspace. Eclipse doesn't require projects to be IN the workspace directory.

为干净的工作空间使用另一个空的(因此干净的)目录。Eclipse不要求项目位于工作区目录中。

#2


9  

Check the File .project and look for The Property

检查文件。项目并查找该属性。

<name>NameOfProject</name>

, The Folder that contains the file, must be named equal to NameOfProject...

,包含文件的文件夹,必须被命名为NameOfProject…

In other manner, the file .project must be contained in a folder with name NameOfProject

在其他方式中,文件.project必须包含在名为NameOfProject的文件夹中。

Please rename the folder.

请重命名文件夹。

#3


6  

Go to Eclipse preferences. Search for workspaces. Remove the workspace that has the same path as your project. Your workspace should be at least one folder up. Restart Eclipse and import your project.

Eclipse首选项。寻找工作区。删除与项目具有相同路径的工作区。您的工作区应该至少有一个文件夹。重新启动Eclipse并导入项目。

Example: Invalid project description. C:\Development\workspace\joy overlaps the workspace location: C:\Development\workspace\joy

例如:无效的项目描述。C:\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \

Remove the \joy workspace and use only C:\Development\workspace\

删除\joy工作区,只使用C:\Development\workspace\。

Good luck.

祝你好运。

#4


3  

Eclipse doesn't allow to open a project that the existing workspace is a subfolder or same folder of that project.

Eclipse不允许打开现有工作区是该项目的子文件夹或相同文件夹的项目。

I agree that the error says the obvious and does not state the issue.

我同意这个错误是显而易见的,并没有说明问题。

Solution: Create the workspace in a higher hierarchy than the project folder OR in a complete separated folder.

解决方案:在更高的层次结构中创建工作空间,而不是在项目文件夹中或在一个完全独立的文件夹中。

* Users who are migrating from IDEA might be confused by the workspace notion of Eclipse. Eclipse's workspace notion is targeted at the potential to embed different projects that don't reside in a mutual folder structure. As this might be a logical notion, most projects in a workspace, from my experience, do reside in the same folder structure, hence misses the 80-20 rule.

从IDEA迁移的用户可能会被Eclipse的工作空间概念所迷惑。Eclipse的工作空间概念针对的是嵌入不同项目的潜力,这些项目不会驻留在相互的文件夹结构中。由于这可能是一个逻辑的概念,工作空间中的大多数项目,根据我的经验,都驻留在相同的文件夹结构中,因此忽略了80-20规则。

#5


2  

I encountered this same problem:

我遇到了同样的问题:

  • I had a project directory called "demo1".
  • 我有一个名为“demo1”的项目目录。
  • I created a new workspace using that same "demo1" directory as the workspace root directory.
  • 我使用与workspace根目录相同的“demo1”目录创建了一个新的工作区。
  • When I went to import that project directory (which was the same as my root workspace directory), I got the "overlaps the workspace" error.
  • 当我导入那个项目目录(与根工作区目录相同)时,我得到了“工作区”错误的“重叠”。

I'm using "Eclipse IDE for C/C++ Developers, Version: Indigo Service Release 2"

我正在使用“Eclipse IDE for C/ c++开发人员,版本:Indigo Service Release 2”

My solution:

我的解决方案:

  • Exit Eclipse
  • 退出Eclipse
  • Delete the .metadata directory (this is created each time you start Eclipse) from inside my workspace directory ("demo1").
  • 从我的工作空间目录(“demo1”)中删除.metadata目录(这是每次启动Eclipse时创建的)。
  • Create a new directory called "demo1" within the existing "demo1" directory. So now I have "demo1/demo1".
  • 在现有的“demo1”目录中创建一个名为“demo1”的新目录。所以现在我有了“demo1/demo1”。
  • Move all the existing files and directories in my existing project, plus the .cproject and .project files (and the .settings directory if it exists), into that new "demo1" subdirectory.
  • 将现有项目中的所有现有文件和目录移动到新的“demo1”子目录中,并将.cproject和.project文件(以及.settings目录)添加到新的“demo1”子目录中。
  • Restart Eclipse, and select the original "demo1" directory as my workspace.
  • 重新启动Eclipse,并选择原始的“demo1”目录作为工作空间。
  • Go to File->Import, select "General" and "Existing projects into workspace". Click Next.
  • 点击文件->导入,选择“一般”和“现有项目进入工作区”。单击Next。
  • Select the new "demo1" subdirectory as the project I wanted to import into my workspace.
  • 选择新的“demo1”子目录作为我想要导入到工作区的项目。
  • Make sure "Copy projects into workspace" is not checked.
  • 确保“将项目复制到工作区”没有被选中。
  • Click Finish, and it worked. Project builds.
  • 点击Finish,它就成功了。项目构建。

FYI.

仅供参考。

Eclipse creates a .metadata directory, a .cproject file, and a .project file (and sometimes a .settings directory). You need the .cproject and .project file, and the .settings directory if it exists. The .metadata directory is a temporary directory which Eclipse creates or updates each time it is opened. It can be deleted without any effect.

Eclipse创建了.metadata目录、.cproject文件和.project文件(有时是.settings目录)。如果存在,您需要.cproject和.project文件,以及.settings目录。元数据目录是一个临时目录,Eclipse在每次打开它时都会创建或更新它。它可以被删除而不产生任何影响。

#6


1  

for me the problem was the following:

对我来说,问题是这样的:

I was trying to import a project that already existed in my default workspace. Think about it; you are selecting "import into workspace" but if you look in your files directory, the project is already in your workspace, thus it's overlapping.

我试图导入一个已经存在于我的默认工作空间中的项目。想想看;您正在选择“导入工作区”,但是如果您查看文件目录,项目已经在您的工作区中,因此它是重叠的。

Here is what I would recommend:

以下是我的建议:

  • from windows file explorer i moved the entire project outside of the default workspace. now i can import it into the work space.

    在windows文件管理器中,我将整个项目移到默认工作空间之外。现在我可以把它导入工作空间。

  • alternatively there is also a few options to import existing code into your workspace ( think its in file --->new project-->android project from existing code , etc etc

    或者,也有一些选项可以将现有的代码导入到您的工作空间中(请考虑它的文件——>新项目——从现有代码中提取的>android项目,等等。

#7


1  

I came upon this today but did not see any answers here that addressed my particular issue. I had copied the contents of my project directly into the workspace (e.g. the src, res, Manifest, etc). You must put your project files into a directory of their own (look in .project and see the exact naming). Create your project directory and move your files into it and you can now import your project into the workspace.

我今天来到这里,但没有看到任何回答我的特殊问题的答案。我将项目的内容直接复制到工作区中(例如src、res、Manifest等)。您必须将您的项目文件放入他们自己的目录中(查看.project,并查看确切的命名)。创建项目目录并将文件放入其中,现在可以将项目导入工作区。

#8


-1  

What I did to solve the problem:

我做了什么来解决这个问题:

  1. Rename the Project.

    重命名这个项目。

    • For example, the issue was with "C:\NividousCode\Production_Daily_HealtchCheck" (Eclipse returned error that this overlaps with another project - which was true I did have another project in another directory called "C:\cjaphe\Production_Daily_HealtchCheck")
    • 例如,问题是“C:\NividousCode\Production_Daily_HealtchCheck”(Eclipse返回的错误与另一个项目重叠——这是真的,我确实在另一个名为“C:\cjaphe\Production_Daily_HealtchCheck”的目录中有另一个项目)。
  2. Solution was to "C:\NividousCode\Production_Daily_HealtchCheck" to "C:\NividousCode\Production_Daily_HealtchCheck_TEMP"

    解决方案是“C:\NividousCode\Production_Daily_HealtchCheck”到“C:\NividousCode\Production_Daily_HealtchCheck_TEMP”

When I the projected, Eclipse did not complain! and worked!

当我预测时,Eclipse没有抱怨!和工作!

#1


33  

Use another EMPTY (thus clean) directory for your clean workspace. Eclipse doesn't require projects to be IN the workspace directory.

为干净的工作空间使用另一个空的(因此干净的)目录。Eclipse不要求项目位于工作区目录中。

#2


9  

Check the File .project and look for The Property

检查文件。项目并查找该属性。

<name>NameOfProject</name>

, The Folder that contains the file, must be named equal to NameOfProject...

,包含文件的文件夹,必须被命名为NameOfProject…

In other manner, the file .project must be contained in a folder with name NameOfProject

在其他方式中,文件.project必须包含在名为NameOfProject的文件夹中。

Please rename the folder.

请重命名文件夹。

#3


6  

Go to Eclipse preferences. Search for workspaces. Remove the workspace that has the same path as your project. Your workspace should be at least one folder up. Restart Eclipse and import your project.

Eclipse首选项。寻找工作区。删除与项目具有相同路径的工作区。您的工作区应该至少有一个文件夹。重新启动Eclipse并导入项目。

Example: Invalid project description. C:\Development\workspace\joy overlaps the workspace location: C:\Development\workspace\joy

例如:无效的项目描述。C:\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \

Remove the \joy workspace and use only C:\Development\workspace\

删除\joy工作区,只使用C:\Development\workspace\。

Good luck.

祝你好运。

#4


3  

Eclipse doesn't allow to open a project that the existing workspace is a subfolder or same folder of that project.

Eclipse不允许打开现有工作区是该项目的子文件夹或相同文件夹的项目。

I agree that the error says the obvious and does not state the issue.

我同意这个错误是显而易见的,并没有说明问题。

Solution: Create the workspace in a higher hierarchy than the project folder OR in a complete separated folder.

解决方案:在更高的层次结构中创建工作空间,而不是在项目文件夹中或在一个完全独立的文件夹中。

* Users who are migrating from IDEA might be confused by the workspace notion of Eclipse. Eclipse's workspace notion is targeted at the potential to embed different projects that don't reside in a mutual folder structure. As this might be a logical notion, most projects in a workspace, from my experience, do reside in the same folder structure, hence misses the 80-20 rule.

从IDEA迁移的用户可能会被Eclipse的工作空间概念所迷惑。Eclipse的工作空间概念针对的是嵌入不同项目的潜力,这些项目不会驻留在相互的文件夹结构中。由于这可能是一个逻辑的概念,工作空间中的大多数项目,根据我的经验,都驻留在相同的文件夹结构中,因此忽略了80-20规则。

#5


2  

I encountered this same problem:

我遇到了同样的问题:

  • I had a project directory called "demo1".
  • 我有一个名为“demo1”的项目目录。
  • I created a new workspace using that same "demo1" directory as the workspace root directory.
  • 我使用与workspace根目录相同的“demo1”目录创建了一个新的工作区。
  • When I went to import that project directory (which was the same as my root workspace directory), I got the "overlaps the workspace" error.
  • 当我导入那个项目目录(与根工作区目录相同)时,我得到了“工作区”错误的“重叠”。

I'm using "Eclipse IDE for C/C++ Developers, Version: Indigo Service Release 2"

我正在使用“Eclipse IDE for C/ c++开发人员,版本:Indigo Service Release 2”

My solution:

我的解决方案:

  • Exit Eclipse
  • 退出Eclipse
  • Delete the .metadata directory (this is created each time you start Eclipse) from inside my workspace directory ("demo1").
  • 从我的工作空间目录(“demo1”)中删除.metadata目录(这是每次启动Eclipse时创建的)。
  • Create a new directory called "demo1" within the existing "demo1" directory. So now I have "demo1/demo1".
  • 在现有的“demo1”目录中创建一个名为“demo1”的新目录。所以现在我有了“demo1/demo1”。
  • Move all the existing files and directories in my existing project, plus the .cproject and .project files (and the .settings directory if it exists), into that new "demo1" subdirectory.
  • 将现有项目中的所有现有文件和目录移动到新的“demo1”子目录中,并将.cproject和.project文件(以及.settings目录)添加到新的“demo1”子目录中。
  • Restart Eclipse, and select the original "demo1" directory as my workspace.
  • 重新启动Eclipse,并选择原始的“demo1”目录作为工作空间。
  • Go to File->Import, select "General" and "Existing projects into workspace". Click Next.
  • 点击文件->导入,选择“一般”和“现有项目进入工作区”。单击Next。
  • Select the new "demo1" subdirectory as the project I wanted to import into my workspace.
  • 选择新的“demo1”子目录作为我想要导入到工作区的项目。
  • Make sure "Copy projects into workspace" is not checked.
  • 确保“将项目复制到工作区”没有被选中。
  • Click Finish, and it worked. Project builds.
  • 点击Finish,它就成功了。项目构建。

FYI.

仅供参考。

Eclipse creates a .metadata directory, a .cproject file, and a .project file (and sometimes a .settings directory). You need the .cproject and .project file, and the .settings directory if it exists. The .metadata directory is a temporary directory which Eclipse creates or updates each time it is opened. It can be deleted without any effect.

Eclipse创建了.metadata目录、.cproject文件和.project文件(有时是.settings目录)。如果存在,您需要.cproject和.project文件,以及.settings目录。元数据目录是一个临时目录,Eclipse在每次打开它时都会创建或更新它。它可以被删除而不产生任何影响。

#6


1  

for me the problem was the following:

对我来说,问题是这样的:

I was trying to import a project that already existed in my default workspace. Think about it; you are selecting "import into workspace" but if you look in your files directory, the project is already in your workspace, thus it's overlapping.

我试图导入一个已经存在于我的默认工作空间中的项目。想想看;您正在选择“导入工作区”,但是如果您查看文件目录,项目已经在您的工作区中,因此它是重叠的。

Here is what I would recommend:

以下是我的建议:

  • from windows file explorer i moved the entire project outside of the default workspace. now i can import it into the work space.

    在windows文件管理器中,我将整个项目移到默认工作空间之外。现在我可以把它导入工作空间。

  • alternatively there is also a few options to import existing code into your workspace ( think its in file --->new project-->android project from existing code , etc etc

    或者,也有一些选项可以将现有的代码导入到您的工作空间中(请考虑它的文件——>新项目——从现有代码中提取的>android项目,等等。

#7


1  

I came upon this today but did not see any answers here that addressed my particular issue. I had copied the contents of my project directly into the workspace (e.g. the src, res, Manifest, etc). You must put your project files into a directory of their own (look in .project and see the exact naming). Create your project directory and move your files into it and you can now import your project into the workspace.

我今天来到这里,但没有看到任何回答我的特殊问题的答案。我将项目的内容直接复制到工作区中(例如src、res、Manifest等)。您必须将您的项目文件放入他们自己的目录中(查看.project,并查看确切的命名)。创建项目目录并将文件放入其中,现在可以将项目导入工作区。

#8


-1  

What I did to solve the problem:

我做了什么来解决这个问题:

  1. Rename the Project.

    重命名这个项目。

    • For example, the issue was with "C:\NividousCode\Production_Daily_HealtchCheck" (Eclipse returned error that this overlaps with another project - which was true I did have another project in another directory called "C:\cjaphe\Production_Daily_HealtchCheck")
    • 例如,问题是“C:\NividousCode\Production_Daily_HealtchCheck”(Eclipse返回的错误与另一个项目重叠——这是真的,我确实在另一个名为“C:\cjaphe\Production_Daily_HealtchCheck”的目录中有另一个项目)。
  2. Solution was to "C:\NividousCode\Production_Daily_HealtchCheck" to "C:\NividousCode\Production_Daily_HealtchCheck_TEMP"

    解决方案是“C:\NividousCode\Production_Daily_HealtchCheck”到“C:\NividousCode\Production_Daily_HealtchCheck_TEMP”

When I the projected, Eclipse did not complain! and worked!

当我预测时,Eclipse没有抱怨!和工作!