开发者

Eclipse shortcut to run a class

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开发者_StackOverflow社区 link to "launch foo.bar.MainClass".


Just use Ctrl + F11. (This is the standard keyboard shortcut to run the class you are working on)

I wish this is what you are looking for... buddy.


  • 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


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.


alt+shift+x+J Rocks


You can go Window -> Preferences -> General -> Key and bind anything you want!I hope it helps!


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


It is Ctrl+F11

Ctrl+Shift+X or Ctrl+Shift+J didn't worked for me!


If you've added these classes to your favorite run configurations (available from the run/debug toolbar buttons as "Organize Favorites..."), then the shortcut key combo is Alt+R,T,1 to run your first favorite, Alt+R,T,2 to run your second, etc. Alt+R,H,# works for debug configs.


on Windows machine ctrl+Fn F11 --- running ctrl+Fn+Shift F11 --- debugging


If you are someone like me who wants to create a shortcut to run a class/program in java directly, you can create your own preferable shortcut in ECLIPSE!

Follow these steps:

Window > Preferences > General > Keys

  1. Select run from command column
  2. Enter your own shortcut in Binding section
  3. Apply and close!!

WARNING: Make sure you don't create a shortcut which is already assigned for a different task!


I cannot this the answer here but : CTRL+SHIFT+T do apparently exactly what you want! :) Maybe it's because you code it by yourself by time...

Watch here: http://eclipse.dzone.com/news/effective-eclipse-shortcut-key for more.


I faced this problem in eclipse too. I have customized the configuration for me.

Windows -> preferances -> keys

Search for your configuration eg "Run Java Application" or just look for its icon.

Select it

and below in the binding field press keyboard keys which you want to add a shortcut for this configuration eg. ctrl + shift + T

and Apply

You are good to go use the same shortcut keys to whenever you need it.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜