eclipse 中终止调试/运行的捷径是什么?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/321118/
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
What is the short cut in eclipse to terminate debugging/running?
提问by cretzel
What is the shortcut in eclipse to terminate debugging/running? Looking under Preferences -> Keys says Ctrl+ F2but it doesn't work.
eclipse 中终止调试/运行的快捷方式是什么?在 Preferences -> Keys 下查看Ctrl+F2但它不起作用。
采纳答案by VonC
As said here, you can add/enable the Debug command group to any perspective usingWindow / Customize Perspective > Commands
.
(Select the 'Debug' group)
至于说在这里,您可以添加/使用启用调试命令组的任何角度Window / Customize Perspective > Commands
。
(选择“调试”组)
Then open the Debug view in the Java perspective (as a Fast view perhaps) and you should get your Terminate keybinding.
然后在 Java 透视图中打开 Debug 视图(可能是 Fast 视图),您应该获得 Terminate 键绑定。
I suppose it was not working because you tried it in a non-debug session.
我想它不起作用,因为您在非调试会话中尝试过它。
回答by Austin
Go to Preferences -> General -> Keys
转到首选项 -> 常规 -> 键
Find "Terminate" Set your binding to whatever you want (in my case F12).
找到“终止”将您的绑定设置为您想要的任何内容(在我的情况下F12)。
Then change "When" from "Debugging" to "Editing Java Source".
然后将“何时”从“调试”更改为“编辑 Java 源代码”。
Works for me, now.
现在对我有用。
Going to Customize Perspective only showed me the bindings I already had, not let me set them.
转到自定义透视图只向我展示了我已经拥有的绑定,而不是让我设置它们。
回答by Jeb
Alright, this is an admittedly lame answer, but here goes. CTRL+F2just isn't working for me (from any perspective). I have no idea why. I'm running 3.5.2
好吧,这是一个公认的蹩脚答案,但在这里。CTRL+F2只是不适合我(从任何角度来看)。我不知道为什么。我正在运行 3.5.2
So I hit Alt, R, T, Enter.
所以我打Alt, R, T, Enter。
Alt, to get to the top menu bar. R, to select the run menu. T, to select terminate. Finally, enterto actually invoke it. It's really not that bad. Lame? Yes. Faster than a mouse click? Certainly.
Alt, 进入顶部菜单栏。R, 选择运行菜单。T, 选择终止。最后,enter实际调用它。这真的没有那么糟糕。瘸?是的。比鼠标点击还快?当然。
回答by gerrytan
Have a debug view open on your perspective (Alt+Shift+Q, Q-> find Debug). Once your application is running, use CTRL+F7(Command+F7on mac) to switch to Debug view, press down to highlight the launched app, and trigger your terminate shortcut
有一个调试视图你的观点开(Alt+ Shift+ Q,Q- >找到调试)。应用程序运行后,使用CTRL+ F7(Mac 上的Command+ F7)切换到调试视图,按下以突出显示启动的应用程序,并触发终止快捷方式
Referring to thisanswer, I don't think it works all the time because depending on what was run, eclipse might not register the 'terminate' command as available.
参考这个答案,我认为它不会一直有效,因为根据运行的内容,eclipse 可能不会将“终止”命令注册为可用。
For example when I run my project using maven (m2e plugin), the terminate button on console view is available, but not on the menu. See screenshot below (I used Springsource Tools Suite 2.9.2 which is based on eclipse indigo, and m2e 1.0.200)
例如,当我使用 maven(m2e 插件)运行我的项目时,控制台视图上的终止按钮可用,但不在菜单上。请参阅下面的屏幕截图(我使用了基于 eclipse indigo 的 Springsource Tools Suite 2.9.2 和 m2e 1.0.200)
This is because the launched application is not selected by default on the debug view.
这是因为默认情况下未在调试视图中选择启动的应用程序。
This problem is discussed on eclipse forum thread here.
这个问题在 eclipse 论坛线程上讨论过。
回答by Boon
Read all these, but found no simple way. So, I threw together a very simple plugin.
阅读了所有这些,但没有找到简单的方法。所以,我拼凑了一个非常简单的插件。
Hope it helps someone else as well.
希望它也能帮助其他人。
回答by Pony
I also ran into this issue, but still didn't find a proper solution.
我也遇到了这个问题,但仍然没有找到合适的解决方案。
Apparently, because multiple user program instances can run together, they (eclipse devs) just didn't put a general terminate key.
显然,因为多个用户程序实例可以一起运行,他们(eclipse devs)只是没有放置一个通用的终止键。
As I just saw in their bugs section, they're (maybe) working on showing a dialog for selecting which running program you want to terminate when you click on the terminate button (probably will be Ctrl+F2 as default).
正如我刚刚在他们的错误部分看到的那样,他们(可能)正在显示一个对话框,用于在您单击终止按钮时选择要终止的正在运行的程序(默认情况下可能是 Ctrl+F2)。
You can see the bug pagefor this issue for further details and updates. hope it helps anyone.
您可以查看此问题的错误页面以获取更多详细信息和更新。希望它可以帮助任何人。
回答by Alexander Wu
A lot of the above answers work for some people but maybe not everyone. As Scott Biggs mentioned, command-F2 may not work on macs (note that to get F2 on a mac, you also need to hold down the fn key), so you can reset the binding to shift-F2. Worked for me, as long as you are debugging.
很多上述答案适用于某些人,但可能不是所有人。正如 Scott Biggs 所提到的,command-F2 在 mac 上可能不起作用(请注意,要在 mac 上获得 F2,您还需要按住 fn 键),因此您可以将绑定重置为 shift-F2。对我来说有效,只要你在调试。
回答by Scott Biggs
F2 could be already used by your Operating System, which can intercept the keystroke before Eclipse gets a chance.
F2 可能已经被您的操作系统使用,它可以在 Eclipse 获得机会之前拦截击键。
On macs, the F2 key is often used to increase the screen brightness. This will take precedence over anything that Eclipse will assign it. Translation: when you hit F2 on some macs (depending on your settings), your screen will (try to) brighten, and Eclipse will do nothing.
在 Mac 上,F2 键通常用于增加屏幕亮度。这将优先于 Eclipse 分配给它的任何内容。翻译:当您在某些 Mac 上按 F2(取决于您的设置)时,您的屏幕将(尝试)变亮,而 Eclipse 将什么也不做。
Hope that helps.
希望有帮助。