What is the short cut in eclipse to terminate debugging/running?

狂风中的少年 提交于 2019-12-17 07:27:29

问题


What is the shortcut in eclipse to terminate debugging/running? Looking under Preferences -> Keys says Ctrl + F2 but it doesn't work.


回答1:


As said here, you can add/enable the Debug command group to any perspective using
Window / Customize Perspective > Commands.
(Select the 'Debug' group)

Then open the Debug view in the Java perspective (as a Fast view perhaps) and you should get your Terminate keybinding.

I suppose it was not working because you tried it in a non-debug session.




回答2:


Go to Preferences -> General -> Keys

Find "Terminate" Set your binding to whatever you want (in my case F12).

Then change "When" from "Debugging" to "Editing Java Source".

Works for me, now.

Going to Customize Perspective only showed me the bindings I already had, not let me set them.




回答3:


Alright, this is an admittedly lame answer, but here goes. CTRL+F2 just isn't working for me (from any perspective). I have no idea why. I'm running 3.5.2

So I hit Alt, R, T, Enter.

Alt, to get to the top menu bar. R, to select the run menu. T, to select terminate. Finally, enter to actually invoke it. It's really not that bad. Lame? Yes. Faster than a mouse click? Certainly.




回答4:


Read all these, but found no simple way. So, I threw together a very simple plugin.

Hope it helps someone else as well.




回答5:


Have a debug view open on your perspective (Alt+Shift+Q, Q -> find Debug). Once your application is running, use CTRL+F7 (Command+F7 on mac) to switch to Debug view, press down to highlight the launched app, and trigger your terminate shortcut

Referring to this answer, I don't think it works all the time because depending on what was run, eclipse might not register the 'terminate' command as available.

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)

This is because the launched application is not selected by default on the debug view.

This problem is discussed on eclipse forum thread here.




回答6:


In the Window Tab, you can see the shortcuts :




回答7:


F2 could be already used by your Operating System, which can intercept the keystroke before Eclipse gets a chance.

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.

Hope that helps.




回答8:


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.

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).

You can see the bug page for this issue for further details and updates. hope it helps anyone.




回答9:


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.



来源:https://stackoverflow.com/questions/321118/what-is-the-short-cut-in-eclipse-to-terminate-debugging-running

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!