如何在 Eclipse 关闭时关闭 Eclipse 工作区中的所有项目?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/8918142/
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
How can I close all projects in an Eclipse workspace while eclipse is closed?
提问by vol
I have a problem with one of my workspaces; if I start eclipse with all of the projects open, eclipse might take 20 minutes to even reach the point where it's even responsive, if not longer.
我的一个工作区有问题;如果我在所有项目都打开的情况下开始 eclipse,eclipse 可能需要 20 分钟才能达到甚至响应的程度,如果不是更长的话。
Is it possible to start eclipse in "safe mode", where none of the projects are open and plugins are disabled, so that I can get my workspace in order?
是否可以在“安全模式”下启动 eclipse,其中没有打开任何项目并且禁用插件,以便我可以按顺序排列我的工作区?
回答by katsharp
I have not found the piece of metadata that says whether or not a project is closed, I suspect it is not possible through that route as I have grepped through the files created and not found one.
我还没有找到说明项目是否关闭的元数据,我怀疑通过该路径是不可能的,因为我已经浏览了创建的文件但没有找到。
I have 2 workarounds, the first of which is:
我有 2 个解决方法,第一个是:
Close Eclipse.
Rename the .project file in the top level of each project (painful to do manually if you have a lot, you could write a script).
Start Eclipse.
Projects should show up as closed.
关闭日食。
在每个项目的顶层重命名 .project 文件(如果你有很多手动做很痛苦,你可以写一个脚本)。
启动日食。
项目应显示为已关闭。
Note: to undo this you will have to revert the name changes (ie turn them all back to .project files) before you try to open them.
注意:要撤消此操作,您必须在尝试打开它们之前还原名称更改(即,将它们全部恢复为 .project 文件)。
The advantages of this approach is that you can work at getting one project behaving at a time (if this is appropriate for your needs).
这种方法的优点是您可以一次让一个项目运行起来(如果这适合您的需要)。
The other approach is to simply create a new workspace, get that set up correctly (whatever it is you need - VCS, correct JRE, Target Platform etc) and then import each of your projects 1 (or more) at a time.
另一种方法是简单地创建一个新工作区,正确设置它(无论您需要什么 - VCS、正确的 JRE、目标平台等),然后一次导入您的每个项目 1 个(或多个)。
This could be more work, depending on how customised your workspace gets (perspective layouts, preferences, code templates etc), however this would give you a clean slate. This might be best if things are truly that bad.
这可能需要更多的工作,具体取决于您的工作区如何自定义(透视布局、首选项、代码模板等),但这会给您一个干净的石板。如果事情真的那么糟糕,这可能是最好的。
Note: basing all this on 3.7.1
注意:所有这些都基于 3.7.1
回答by user1626000
Right click on one of the open projects ---> Close unrelated projects.
右键单击打开的项目之一 ---> 关闭不相关的项目。
It closes all projects except that one.
它会关闭除那个项目之外的所有项目。
回答by dk_2094
I havent found any such method but you can do this while eclipse is running. Go to package Explorer , select all the projects then go to Project -> Close Project. This will close all the projects.So next time when you start Eclipse, it will not load all the projects and it will response earlier than before.
我还没有找到任何这样的方法,但是您可以在 eclipse 运行时执行此操作。转到 package Explorer ,选择所有项目,然后转到 Project -> Close Project。这将关闭所有项目。因此,下次启动 Eclipse 时,它不会加载所有项目,并且会比以前更早地响应。
回答by Sarfaraaz Ansari
This worked for me:
这对我有用:
- Click on the Package Explorer region and press
Ctrl + a
- Then, as usual, right click and choose option "Close Projects" and all projects will be closed
- 单击 Package Explorer 区域并按
Ctrl + a
- 然后,像往常一样,右键单击并选择选项“关闭项目”,所有项目将被关闭