如何清理 Eclipse“运行配置”
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/9247089/
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 clean up Eclipse "run configurations"
提问by H2ONaCl
I set my java runtime options in Eclipse's Window > Prefs > Java > Installed JREs > Default VM Arguments. Since this setting is sufficient for all my main()
entry points, I do not bother with customizing the "run configurations". It looks like nice flexibility but I probably will never need it. I was worried that I would have to repeat my VM arguments in the run configurations and so I started to copy my VM arguments but after an experiment it seems that I do not have to. Now I will have the opposite worry that I have some unintended customizations.
我在 Eclipse 的 Window > Prefs > Java > Installed JREs > Default VM Arguments 中设置了我的 java 运行时选项。由于这个设置对于我所有的main()
入口点来说已经足够了,所以我不打算自定义“运行配置”。它看起来很灵活,但我可能永远不需要它。我担心我必须在运行配置中重复我的 VM 参数,所以我开始复制我的 VM 参数,但经过实验后,我似乎不必这样做。现在我会担心我有一些意外的自定义。
To eliminate the second worry, is there a way to eliminate the clutter visible in the Run drop down menu? What about the "Launch configurations" visible in the JAR export dialog? Is a run configuration the same thing as a launch configuration? How do I eliminate the multiple launch configurations?
为了消除第二个顾虑,有没有办法消除运行下拉菜单中可见的混乱?JAR 导出对话框中可见的“启动配置”怎么样?运行配置是否与启动配置相同?如何消除多个启动配置?
I am on Eclipse Indigo on Ubuntu.
我在 Ubuntu 上使用 Eclipse Indigo。
EditAfter I manually delete all the run configurations, and proceed to do an export, buttons are greyed-out so I can't proceed. When I select the launch configuration drop-down, I end up with only one choice, from an unrelated project. I then created a run configuration for the real main
entry point for the current project. I expect the clutter will return as I continue to use Eclipse.
编辑在我手动删除所有运行配置并继续进行导出后,按钮变灰,因此我无法继续。当我选择启动配置下拉列表时,我最终只有一个选择,来自一个不相关的项目。然后我main
为当前项目的真实入口点创建了一个运行配置。我希望随着我继续使用 Eclipse,混乱会回来。
采纳答案by H2ONaCl
The answer comes from @Francisco Puga
Experimental evidence shows that deleting "launches" seems to make run configurations disappear so it would seem that they might be synonymous.
实验证据表明,删除“启动”似乎会使运行配置消失,因此它们似乎是同义词。
回答by VonC
One simple way would be to organize your projects by Eclipse workspace, which would limit the "run configurations" list only to the project referenced in a given workspace.
Switching workspaces would reset that list to the ones recorded for the projects of the new workspace.
一种简单的方法是按Eclipse 工作区组织您的项目,这会将“运行配置”列表限制为仅在给定工作区中引用的项目。
切换工作区会将该列表重置为为新工作区的项目记录的列表。
Note: the OP's answerregarding launches file location isn't the only location possible.
The official one is:
注意:OP关于启动文件位置的回答并不是唯一可能的位置。
官方的一种是:
${WORKSPACE}/.metadata/.plugins/org.eclipse.debug.core/.launches
But you can copy them enywhere else you want (as explained in "How do I save Eclipse launch profiles across workspaces?"), either by manually copying those files or by sharing them:
See "Which eclipse files belong under Version Control".
但是您可以将它们复制到您想要的任何其他位置(如“如何跨工作区保存 Eclipse 启动配置文件?”中所述),方法是手动复制这些文件或共享它们:
请参阅“哪些 eclipse 文件属于版本控制”。
Once you know where they are saved, a simple delete is enough to make them disappear from the launcher menu.
一旦您知道它们的保存位置,简单的删除就足以使它们从启动器菜单中消失。