Showing posts with label productivity. Show all posts
Showing posts with label productivity. Show all posts

Mar 16, 2010

Eclipse - Run / Debug - The Fast Way

Ok. This was so awesome, I had to stop everything and blog about it, simply because every Eclipse user on earth should hear about this.

Problem

So, in Eclipse, I got fed up always clicking through a thousand menus to run my application. I'm using maven, so to run our project, I have to mouse over to our POM.xml, right click on it, mouse ALL THE WAY down to "Run As" (of course, I always forgetfully mouse over "Maven," instead), then mouse ALL THE WAY down to "Maven build," then I have 6-8 run configurations to choose from so I have to mouse ALL THE WAY over to the middle of the screen and pick one!

Clearly, I HATE MOUSING. So I hunted down a better way.

Now all I have to do is hit COMMAND + SHIFT + F11 (ctrl + F11 on windows) to run my last-used configuration. This command already works by default on plain Java files but when you start getting fancy with the run configurations . . . and Maven . . . and things . . . it doesn't function the same.

Solution

  1. Hit COMMAND + , to open preferences (without the stinkin' mouse!)
  2. Begin typing. Enter "Launching" in the filter box
  3. Open the Launching preferences
  4. In the bottom section, choose "Always launch the previously launched application"
  5. Click OK. Celebrate victory.

This used to be the default behavior in Eclipse. A while ago, it changed so that it now makes a best guess based on your active resource and editor. That works perfectly . . . until you start doing things more complex. Now the CMD+SHFT+F11 shortcut key runs your last run/debug choice! That alone, will save BOATLOADS of time. Some days, I click "Maven Build" no less than 1 billion times!