Eclipse 导入项目错误,工作区位置重叠
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/6594084/
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
Eclipse import project error, overlaps workspace location
提问by Adrian
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.
谢谢。
采纳答案by Manuel Selva
Use another EMPTY (thus clean) directory for your clean workspace. Eclipse doesn't require projects to be IN the workspace directory.
为干净的工作区使用另一个 EMPTY(因此是干净的)目录。Eclipse 不要求项目位于工作区目录中。
回答by joseluisbz
Check the File .projectand look for The Property
检查文件.project并查找属性
<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.
请重命名文件夹。
回答by Rickard Nilsson
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:\Development\workspace\joy 重叠工作区位置:C:\Development\workspace\joy
Remove the \joy workspace and use only C:\Development\workspace\
删除 \joy 工作区并仅使用 C:\Development\workspace\
Good luck.
祝你好运。
回答by AlikElzin-kilaka
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 规则。
回答by Matt K
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 并查看确切的命名)。创建您的项目目录并将您的文件移动到其中,您现在可以将您的项目导入到工作区中。
回答by kermit
I encountered this same problem:
我遇到了同样的问题:
- I had a project directory called "demo1".
- I created a new workspace using that same "demo1" directory as the workspace root directory.
- When I went to import that project directory (which was the same as my root workspace directory), I got the "overlaps the workspace" error.
- 我有一个名为“demo1”的项目目录。
- 我使用与工作区根目录相同的“demo1”目录创建了一个新工作区。
- 当我导入该项目目录(与我的根工作区目录相同)时,出现“与工作区重叠”错误。
I'm using "Eclipse IDE for C/C++ Developers, Version: Indigo Service Release 2"
我正在使用“面向 C/C++ 开发人员的 Eclipse IDE,版本:Indigo Service Release 2”
My solution:
我的解决方案:
- Exit Eclipse
- Delete the .metadatadirectory (this is created each time you start Eclipse) from inside my workspace directory ("demo1").
- Create a new directory called "demo1" within the existing "demo1" directory. So now I have "demo1/demo1".
- Move all the existing files and directories in my existing project, plus the .cprojectand .projectfiles (and the .settingsdirectory if it exists), into that new "demo1" subdirectory.
- Restart Eclipse, and select the original "demo1" directory as my workspace.
- Go to File->Import, select "General" and "Existing projects into workspace". Click Next.
- Select the new "demo1" subdirectory as the project I wanted to import into my workspace.
- Make sure "Copy projects into workspace" is not checked.
- Click Finish, and it worked. Project builds.
- 退出 Eclipse
- 从我的工作区目录(“demo1”)中删除.metadata目录(这是每次启动 Eclipse 时创建的)。
- 在现有的“demo1”目录中创建一个名为“demo1”的新目录。所以现在我有了“demo1/demo1”。
- 将现有项目中的所有现有文件和目录,以及 .cproject和.project文件(以及.settings目录,如果存在)移动到新的“demo1”子目录中。
- 重启Eclipse,选择原来的“demo1”目录作为我的工作区。
- 转到 File->Import,选择“General”和“Existing projects into workspace”。点击下一步。
- 选择新的“demo1”子目录作为我想要导入到我的工作区的项目。
- 确保未选中“将项目复制到工作区”。
- 单击完成,它起作用了。项目建立。
FYI.
供参考。
Eclipse creates a .metadatadirectory, a .cprojectfile, and a .projectfile (and sometimes a .settingsdirectory). 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 目录(如果存在)。.metadata 目录是 Eclipse 每次打开时创建或更新的临时目录。它可以被删除而没有任何影响。
回答by j2emanue
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.
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
从 Windows 文件资源管理器中,我将整个项目移到了默认工作区之外。现在我可以将它导入到工作空间中。
或者,还有一些选项可以将现有代码导入您的工作区(认为它在文件中 ---> new project--> android project from existing code 等
回答by Norman Skinner
From what ever root you have, keep your workspace folder separate from your code folder. So maybe:
从您拥有的任何根目录开始,将您的工作区文件夹与您的代码文件夹分开。所以也许:
C:\code\...
C:\workspace\
Like Ghostbusters, don't let the streams cross.
像捉鬼敢死队一样,不要让溪流交叉。
回答by charles japhe
What I did to solve the problem:
我做了什么来解决这个问题:
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"
)
- For example, the issue was with
Solution was to
"C:\NividousCode\Production_Daily_HealtchCheck"
to"C:\NividousCode\Production_Daily_HealtchCheck_TEMP"
重命名项目。
- 例如,问题出在
"C:\NividousCode\Production_Daily_HealtchCheck"
(Eclipse 返回了与另一个项目重叠的错误 - 这是真的,我在另一个名为 的目录中确实有另一个项目"C:\cjaphe\Production_Daily_HealtchCheck"
)
- 例如,问题出在
解决办法是
"C:\NividousCode\Production_Daily_HealtchCheck"
到"C:\NividousCode\Production_Daily_HealtchCheck_TEMP"
When I the projected, Eclipse did not complain! and worked!
当我投影的时候,Eclipse没有抱怨!并工作!