Java 可以将整个工作区导入 eclipse 吗?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/20004203/
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
Can one import an entire workspace into eclipse?
提问by Sev
I have searched around the interwebs and have failed to find the answer to this question so I thought I would ask the wise people here.
我已经在互联网上搜索并没有找到这个问题的答案,所以我想我会在这里问聪明的人。
I reformatted my computer recently and I backed up all my data including my Eclipse workspace but I failed to export my projects using Eclipse itself. I replaced my workspace file back into Eclipse but it does not show any of my projects as run-able Eclipse projects. Is there a provision to import a whole workspace into Eclipse? Is there information in other files that Eclipse requires or will I just need to manual rebuild the project? Thanks for your help and advice all.
我最近重新格式化了我的计算机并备份了我的所有数据,包括我的 Eclipse 工作区,但我无法使用 Eclipse 本身导出我的项目。我将我的工作区文件替换回 Eclipse,但它没有将我的任何项目显示为可运行的 Eclipse 项目。是否有将整个工作区导入 Eclipse 的规定?Eclipse 需要的其他文件中是否有信息,或者我只需要手动重建项目?感谢大家的帮助和建议。
采纳答案by Dark Knight
You need to browse earlier workspace. Projects inside workspace automatically appears in project panel. However if they don't, goto File-> import menu and select "import existing" and browse to project folder in workspace. It should work.
您需要浏览较早的工作区。工作区内的项目会自动出现在项目面板中。但是,如果没有,请转到文件-> 导入菜单并选择“导入现有”并浏览到工作区中的项目文件夹。它应该工作。
回答by PurkkaKoodari
You can right click on the Package Explorer and select Import. There is an option called Existing projects into workspace. Select that and then select your folder. It will show importable projects. Select them all and import.
您可以右键单击包资源管理器并选择导入。有一个名为 Existing projects into workspace 的选项。选择它,然后选择您的文件夹。它将显示可导入的项目。全部选择并导入。
回答by Luís de Sousa
You can open directly a Workspace created with an earlier version Eclipse. The new instance will then update the Workspace to the newer metadata configuration. This might prevent earlier Eclipse versions of opening the updated Workspace.
您可以直接打开使用早期版本 Eclipse 创建的工作区。然后,新实例会将工作区更新为更新的元数据配置。这可能会阻止早期 Eclipse 版本打开更新的工作区。
To deal with this I keep Workspaces of different Eclipse versions in different folders, in a structure like this:
为了解决这个问题,我将不同 Eclipse 版本的工作区保存在不同的文件夹中,结构如下:
Eclipse.Neon
├── Workspace.DomainA
└── Workspace.DomainB
Eclipse.Oxygen
├── Workspace.DomainX
└── Workspace.DomainY
If I wish to import, say, DomainA to Eclipse Oxygen I simply copy it to the Eclipse.Oxygen
folder:
如果我想将 DomainA 导入 Eclipse Oxygen,我只需将其复制到Eclipse.Oxygen
文件夹中:
cp -r Eclipse.Neon/Workspace.DomainA Eclipse.Oxygen/
cp -r Eclipse.Neon/Workspace.DomainA Eclipse.Oxygen/
And then open that Workspace with Oxygen.
然后使用 Oxygen 打开该工作区。
One final note: Workspace management is considerably easier if projects are kept outside its folder, e.g. in a general code versioning folder like git
or svn
.
最后一个注意事项:如果项目保存在其文件夹之外,例如在像git
或 之类的通用代码版本控制文件夹中,则工作区管理会容易得多svn
。