53

I have several launch configurations in Eclipse each launching the same Java program but with different parameters.

Now is it possible to run all of these at once (with one mouse click) instead of selecting each of it separately and launching it?

Lii
  • 11,553
  • 8
  • 64
  • 88
clamp
  • 33,000
  • 75
  • 203
  • 299

6 Answers6

48

EDIT: According to this answer since Eclipse Oxygen (4.7.0) you can use a run configuration of the type Launch Group for that.


Just install "C/C++ Development Tools" from the CDT (see eclipse.org/cdt/downloads.php ) - this single package is enough, no other CDT packages are needed. This won't disturb your Java environment ;-) Then you have "Launch Groups", for any kind of project, including Java projects. See the following screenshot:

enter image description here

You can run or debug the projects (also mixed mode), define delay times and so on. Have fun!

Andi
  • 3,234
  • 4
  • 32
  • 37
  • 1
    This really doesn't seem like a "single package" to me. Through dependencies it also loads the entire C/C++ Development Platform and GDB. – studgeek Nov 25 '12 at 00:44
  • You are right. It looked like a single package at first glance, but as you said, there are dependencies. However, it does not disturb your Eclipse setup in any way, so it should be fine. – Andi Feb 28 '13 at 11:12
  • 4
    As found [here](http://stackoverflow.com/questions/9003337/what-installable-component-provides-launch-groups-in-eclipse#answer-11369639), only "C/C++ Remote Launch" is required to have "Launch group" feature. Optionnally, you can vote for [Eclipse Bug 39900](https://bugs.eclipse.org/bugs/show_bug.cgi?id=39900) in order to migrate this feature from CDT to platform. – LoganMzz Apr 13 '15 at 07:59
  • I tried running a number of JUnit plug-in tests in sequence, and it I found no way of figuring out which tests failed, after the launch group was done, except when they happen to be in the last configuration of the group. Very unfortunate because otherwise this is exactly what I need. – Max Hohenegger Apr 21 '15 at 14:49
  • does launch group support chaining launch configurations? I have a couple of maven configurations that had to be built linearly, launch group triggers all in parallel. – SDS May 07 '15 at 20:27
  • Found out that setting Action to "Wait until terminated" does build sequentially :) – SDS May 08 '15 at 15:58
41

I found this post on the Eclipse trackers: Start multiple debug configurations at once

While it talks about multi-launching debug configurations, I think it is just as applicable to run configurations.

Launch Group

You may want to right click a run configuration in group launch and configure it.

Launch sequential

Yusuf K.
  • 4,195
  • 1
  • 33
  • 69
anirvan
  • 4,797
  • 4
  • 32
  • 42
  • yep that would be exactly what i need. do you know how to pull this launch group thing out of the CDT and into java eclipse? – clamp Oct 29 '10 at 19:46
  • 3
    No hacking necessary. Just install "C/C++ Development Tools" from the CDT (see http://www.eclipse.org/cdt/downloads.php ) - this single package is enough to have "Launch Groups". Works for all kinds of projects, including Java projects. – Andi Aug 10 '12 at 16:06
  • 3
    This really does not seem like a "single package" to me. Through dependencies it also loads the entire C/C++ Development Platform and GDB. – studgeek Nov 25 '12 at 00:44
  • 1
    As found [here](http://stackoverflow.com/questions/9003337/what-installable-component-provides-launch-groups-in-eclipse#answer-11369639), only "C/C++ Remote Launch" is required to have "Launch group" feature. Optionnally, you can vote for [Eclipse Bug 39900](https://bugs.eclipse.org/bugs/show_bug.cgi?id=39900) in order to migrate this feature from CDT to platform. – LoganMzz Apr 13 '15 at 07:59
  • According to [this answer](https://stackoverflow.com/a/47302032/394431) CDT is no longer needed for Launch Group configurations. – Robert Tupelo-Schneck Feb 02 '22 at 18:47
12

Since Eclipse Oxygen (4.7.0) you can use a run configuration of the type Launch Group for that.

This short video shows how to use a Launch Group.

howlger
  • 31,050
  • 11
  • 59
  • 99
0

There are two more options listed in Launch an Eclipse Run Configuration from ANT.

You could group them in Ant and then call them using Ant4Eclipse. Or call multiple launch configs from a command script using eclipse remote control.

Community
  • 1
  • 1
studgeek
  • 14,272
  • 6
  • 84
  • 96
-1

You can create a separate class that calls your program with different arguments, and run it instead.

public class YourClass {
    public static void main(String arg){
        System.out.println(arg);
    }
}

public class YourClassTester {
    public static void main(String[] args){
        YourClass.main("SomeArg1");
        YourClass.main("SomeArg2");
        YourClass.main("SomeArg3");
    }
}
dpatchery
  • 508
  • 5
  • 19
-4

You don't need any plugin:

  1. Create all Run Configurations in eclipse
  2. Select Organize Favorites...
  3. Add you favorites, done

Screenshot

Uooo
  • 6,204
  • 8
  • 36
  • 63
Ryan
  • 53
  • 6