0

Before asking - I have checked similar questions and was not able to achieve my goal so far. My trouble resulted from CTRL+F2 not working in Eclipse. Therefore I spent time looking for shortcut settings and tested solutions here

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

or here

Eclipse Terminate Keyboard Shortcut

yet none of this seems to work.

By now I have discovered the reason why, so here is the question:

Why is my context menu Run > Terminate greyed out, even though a Java application is launched?

The steps I am taking are:

1) ALT+R to open Run context menu

2) N to open Run Configurations

3) ALT+R to run my configuration

4) The application launches as expected

5) Now I switch back to Eclipse and press ALT+R again - Terminate is greyed out, while the application is running.

Why is that?

Note:

This is the reason for the terminate shortcut not working properly, because this context menu entry is annotated with the according shortcut, as long as it is greyed out nothing will ever happen.

I am also in the Debug perspective.

Pressing the red rectangled Stop UI element will still kill the application, as it should. All the while the context menu entry in Run remains greyed out. Why would these two even map to different things?

Thanks in advance for any kind of insight.

Koenigsberg
  • 1,726
  • 1
  • 10
  • 22

2 Answers2

0

This is only enabled when you have selected the application in the Debug view.

greg-449
  • 109,219
  • 232
  • 102
  • 145
0

I was able to achieve what I was looking for with help of @greg-449.

The setup is now as follows:

In Eclipse open Window > Preferences > General > Keys > Show View (Debug) set a shortcut to ALT+ SHIFT + F2 as suggested in the sources I linked. Set binding to In Windows.

Now after launching it is possible to press the newly set shortcut to open debug and after that the Terminate context menu will become available, even though there is apparently no way to call Terminate all which is what the UI element does.

In conclusion, it is complicated, but at least it works. Being forced to manage launches this way still seems absurd to me, however.

Koenigsberg
  • 1,726
  • 1
  • 10
  • 22