Java Eclipse 不导入项目
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/19666049/
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 Not Importing Projects
提问by user2929289
I have tried to import my university work into my eclipse at home, however it claims it cannot find any of the projects.
我曾尝试将我的大学工作导入到我家的 eclipse 中,但它声称找不到任何项目。
The projects are in one folder, called programming, situated on my desktop, while my eclipse program files are in a separate folder, also on the desktop.
这些项目位于我桌面上的一个名为programming 的文件夹中,而我的eclipse 程序文件位于一个单独的文件夹中,也在桌面上。
When opening eclipse it asks for the workspace to select, which is just where all of my projects are located on the desktop: "C:\Users\'username'\desktop\programming"
打开 eclipse 时,它要求选择工作区,这就是我所有项目在桌面上的位置:“C:\Users\'username'\desktop\programming”
Once eclipse has loaded, i go to file, import, existing projects into workspace and select the root directory as the programming folder.
加载 Eclipse 后,我转到文件、导入、现有项目到工作区并选择根目录作为编程文件夹。
At this point, on my laptop, it then finds all of my projects and i can import them without a hitch, but on my PC, it says it is unable to find any projects to import.
此时,在我的笔记本电脑上,它会找到我的所有项目,我可以顺利导入它们,但是在我的 PC 上,它说无法找到任何要导入的项目。
I am 100% sure i am importing them correctly, as i have done the exact same process on my laptop, using exactly the same files (i transferred them from my laptop), i can't quite understand why it's not working this time.
我 100% 确定我正确导入了它们,因为我在笔记本电脑上完成了完全相同的过程,使用了完全相同的文件(我从笔记本电脑传输了它们),我不太明白为什么这次它不起作用。
Thanks in advance for your help,
在此先感谢您的帮助,
Matt
马特
采纳答案by SarZ
- Close eclipse
- Delete the .metadata folder
- Restart the eclipse
- Eclipse will ask for new work space location
- Provide a FRESH location
- Now import the projects one by one
- Don't select the option of "Copy projects into workspace"
- 关闭日食
- 删除 .metadata 文件夹
- 重启日食
- Eclipse 将要求新的工作空间位置
- 提供一个新鲜的位置
- 现在一一导入项目
- 不要选择“将项目复制到工作区”选项
See if this helps.
看看这是否有帮助。
回答by Troncador
A eclipse project have some hidden file an folders, like .classpath, .project and .settings
Eclipse 项目有一些隐藏文件和文件夹,如 .classpath、.project 和 .settings
If your folder have not this files is not a eclipse project
如果你的文件夹没有这个文件就不是eclipse项目
回答by Matt Clark
I have had encountered this problem before, and the solution for me has been to recreate the
workspace
.
我以前遇到过这个问题,我的解决方案是重新创建
workspace
.
Just delete the .metadata
forder, this will reset all your workspace setting!.
只需删除.metadata
转发器,这将重置您的所有工作区设置!。
回答by user1807337
I would recommend you to keep the workspace area separate from your project. Have your project in
我建议您将工作区与您的项目分开。让你的项目在
c:\project\myProject
Remove all the eclipse related files as mentioned by @Troncador from your project directory and then reload the project into Eclipse workspace, say c:\users\xxx\myProject
从您的项目目录中删除@Troncador 提到的所有与 Eclipse 相关的文件,然后将项目重新加载到 Eclipse 工作区中,例如 c:\users\xxx\myProject
This way you start fresh.
这样你就可以重新开始。
回答by alansiqueira27
I tried all the answers, but I was only able to solve it by changing the Workspace path of Eclipse... huh...
所有的答案我都试过了,但是我只能通过改变Eclipse的工作区路径来解决它......呵呵......
回答by Sarneet Kaur
I ran into this issue and couldn't see my project (after import), which was copied from my other project. The fix for me was to delete .classpath
, .project
and .settings/
and re-import the project.
我遇到了这个问题,看不到我的项目(导入后),这是从我的另一个项目中复制的。对我来说,修复是删除.classpath
,.project
并.settings/
并重新导入项目。
rm -rf .settings/
rm .project
rm .classpath
回答by qwyster
You don't need to delete the .metadata folder! Try importing your project as "Projects from Folder or Archive" first. If it doesn't work, restart Eclipse and import the project as "Existing Projects into Workspace".
您不需要删除 .metadata 文件夹!首先尝试将您的项目作为“来自文件夹或存档的项目”导入。如果它不起作用,请重新启动 Eclipse 并将项目作为“Existing Projects into Workspace”导入。