How to make the start button launch a project, not a file, in Eclipse

I am using the Spring IDE, an Eclipse option to create a Java project. One big annoyance that I'm experiencing is that when I press the start button, Eclipse tries to run the current file, which usually fails because it does not have a main method. I set up the launch configuration in the hope that the default play button will match the launch configuration instead of the current file, but that won't work either.

Now, in order to launch my application correctly, I have to click the small arrow next to the game, select my favorite launch configuration, and then it works, these are just two additional clicks, but this is tedious, the button is small, and I feel that I should not You need to complete these additional steps. I mean, what's the point of running configurations and projects if it is still trying to run the default file? Even more preferably, I don’t even want to touch the mouse, but just press Ctrl + F11 , but this has the same behavior. All of the above also applies to debugging, as well as to btw.

So my question is this: how to make the launch and debug buttons (and their short keys) use the project launch configuration by default, and not try (and not work) to work only with the current file? Like in Visual Studio and other IDEs?

+4
source share
2 answers

You can control what the start button does in the settings, in the Run / Debug β†’ Startup section. Choosing "Always run a previously launched application", although not quite what you need, will at least stop annoying attempts to run inappropriate files.

+6
source

You can assign keyboard shortcuts in the settings, but I'm not sure what the display function is. If so, where would it be.

Alternatively, you can extend Eclipse with a small plugin to create a menu that you can customize to do what you like.

0
source

Source: https://habr.com/ru/post/1441775/


All Articles