1

I'm developping a Java application with a class containing main. I can start the application using Ctrl+Alt+X J subsequently the application can be re-run by hitting Alt+R T Enter to choose the menu option for the first item in the Run history.

But to stop the application, I have to click on the small red square in the console view. This is annoying, because it forces me to use the mouse, type Alt+R T Enter then re-focus the editor using the mouse again.

Eclipse being so configurable, there must be a keyboard shortcut to stop the application run in the current console I haven't found. There are an entry in Window > Preferences > Keys called Terminate and Terminate and Relaunch but no matter what binding I assign or what when conditions I set and no matter if I use the Debug perspective or not, they don't seem to fire.

Please help an Eclipse newbie avoiding the mouse :)

kba
  • 1,117
  • 9
  • 20

1 Answers1

0

Go to Preferences -> General -> Keys

Find "Terminate" Set your binding to whatever you want.

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

Sean F
  • 2,352
  • 3
  • 28
  • 40
  • I tried this, but it doesn't work. Nothing happens when I press Ctrl+F2. – kba Mar 07 '13 at 11:01
  • Apparently `Terminate` is only available when the program is started not with the **Run** but the **Debug** option. Instead of re-starting with `Alt+R T Enter`, I now use `Alt+R H Enter` and can use `Ctrl+F2` as the terminate shortcut. Sweet :) – kba Mar 08 '13 at 02:05
  • Apparently, Eclipse is keeping the code in sync with the JVM for the started process when in Debug mode. This means that restarting is not necessary in most cases and if it is, it is possible to do so in one click (Eclipse will show a dialog). This ... is awesome ^^ No keyboard shortcuts, no mouse clicking, it just works. – kba Mar 08 '13 at 02:37
  • 2
    It's still not working for me even if I started it in debug mode! – Kevin Lee Mar 13 '14 at 06:05