views:

267

answers:

5

I have an Eclipse project where I often launch the same java class. I have added my run configuration to the favorites menu, but to launch it I still need to click on the run-drop-down menu and click the icon - is there any way to associate a shortcut to this? When I searched for it I got lost in all the plugins & other things which seemed to be not so simple.

edit: Let me clarify, I want something I can type the moment I start eclipse, regardless of what page I'm viewing, so no "run last" or "run current"; I want F12 to link to "launch foo.bar.MainClass".

+2  A: 

You can configure your launch behaviour so Ctrl-F11 will launch the last launched application again, regardless of your current editor selection.

Look at "Run/Debug" - "Launching" within the eclipse preferences.

tangens
I know that, but that's not what I want.
Frank Meulenaar
You wanted a shortcut, you got a shortcut. What's wrong?
Willi
I've updated my OP
Frank Meulenaar
+3  A: 
  • Open the workspace preferences by the menu: Window -> Preferences
  • Select from the tree: Run/Debug -> Launching
  • Now the 'Launching' preferences are seen.
  • At the bottom there is 'Launch Operation'
  • Use the option 'Always launch the previously launched application'
Verhagen
+1  A: 

alt+shift+x+J Rocks

ibrahimyilmaz
+1 because it's what I would say too but it requires that the Main class is focused.
Hubert
+1  A: 

You should put in a feature request in the eclipse bug tracker (or vote up an existing equivalent feature request) or code it yourself.

Jherico
Yeah, I'm pretty sure you can't assign shortcuts to launch configurations in Eclipse. Wish you could.
JW
A: 

You find a list of Eclipse shortcuts here: http://www.vogella.de/articles/EclipseShortcuts/article.html

Lars Vogel
@Lars: also http://stackoverflow.com/questions/1986195/eclipse-list-of-default-keyboard-shortcuts/1986236#1986236. But that doesn't *exactly* answer the OP's interesting question: how would you link a *specific* launcher to a shortcut?
VonC