Reputation: 9638
I'm using the Spring IDE, a variant of Eclipse to create a Java project. One big irritation I have is that when I press the run button Eclipse tries to run the current file, which usually fails because it doesn't have a main
method. I've set up run configurations in the hope that would make the play button default to the run configuration instead of the current file, but that doesn't work either.
Now to run my application correctly I have to press the little arrow next to play, select my favorite run configuration and then it works, this is only two extra clicks but it's tedious, the button is small and I feel like I shouldn't have to perform these extra steps. I mean what is the point of run configurations and projects if it still tries to run a file by default? Even more preferably I wouldn't even want to touch the mouse but just press Ctrl+F11, but this has the same behavior. All above applies to debugging as well btw.
So my question is this: how do I make the run and debug buttons (and their short keys) default to the project's run configuration instead of to trying (and failing) to run only the current file? Much like it is in Visual Studio and other IDEs?
Upvotes: 4
Views: 2108
Reputation: 2768
You can assign shortcut keys in preferences, but I'm not sure that's a mappable function. If it is, that's where it would be though.
Outside of that you can extend Eclipse with a small plugin to make a menu that you can set to do whatever you like.
Upvotes: 0
Reputation: 3009
You can control what the Launch button does in the preferences, under Run/Debug -> Launching. Choosing "Always run the previously launched application", while not exactly what you're after, will at least stop the annoying attempts to launch inappropriate files.
Upvotes: 6