tags:

views:

619

answers:

3

One of the most frequent thing I do with Eclipse is to re-run the last program. I do it by going to Run -> Run History -> [top most item].

Is there a shortcut key that does this?

Edit: I know of CTRL+F11 but this does not work for me. It will launch the most recent program only if the currently active class (the class whose source code I am editing) does not have a main method. If it does it will use this class as the entry point for the program and not the one from the Run History list.

+2  A: 

Yes, Ctrl-F11.

Bombe
Thanks, this does not solve my problem. See my edit above. Thanks.
Itay
+1  A: 

Ctrl-F11

And also you don't need to go to Run --> Run History. You can just click the small down arrow button next to the Run button (This looks like a green circle with a white play symbol in it) on your toolbar.

ZiG
Yes, but when you're in the zone, keyboard works faster than a mouse
Itay
Exactly. Set the CTRL-F11 properly.
ZiG
+11  A: 

For CTRL+F11 to work the way you want, you must set (from "Windows/Preferences") the
"Run/debug > Launching : Launch Operation" setting to:

Always launch the previously launched application


As Thorbjørn Ravn Andersen mentions in the comment, launching the last app used to be (3.2 or before) the default behavior.
Since 3.3M6 (March 2007), As illustrated by this thread:

By default, running and debugging applications has been simplified to run or debug the selected file or active editor.
When the selected resource (or active editor) is not executable, users can opt to launch the associated project or re-launch the previous launch.

These settings are managed on the Run/Debug > Launching preference page.
Users can also revert to the 3.2 behavior of always launching the previous application.

VonC
This is actually the historic behaviour of Ctrl-F11. Shame on those who changed.
Thorbjørn Ravn Andersen