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

后端 未结 9 544
说谎
说谎 2020-11-30 07:11

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

相关标签:
9条回答
  • 2020-11-30 07:41

    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)

    When running maven, console view terminate button is available but not on Run menu

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

    This problem is discussed on eclipse forum thread here.

    0 讨论(0)
  • 2020-11-30 07:41

    In the Window Tab, you can see the shortcuts :

    0 讨论(0)
  • 2020-11-30 07:42

    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.

    0 讨论(0)
  • 2020-11-30 07:44

    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.

    0 讨论(0)
  • 2020-11-30 07:45

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

    Hope it helps someone else as well.

    0 讨论(0)
  • 2020-11-30 07:46

    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.

    0 讨论(0)
提交回复
热议问题