Running multiple launch configurations at once
Asked Answered
G

6

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?

Geniagenial answered 29/10, 2010 at 15:19 Comment(0)
R
42

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

Ransom answered 29/10, 2010 at 16:59 Comment(5)
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?Geniagenial
No hacking necessary. Just install "C/C++ Development Tools" from the CDT (see eclipse.org/cdt/downloads.php ) - this single package is enough to have "Launch Groups". Works for all kinds of projects, including Java projects.Cavorilievo
This really does not seem like a "single package" to me. Through dependencies it also loads the entire C/C++ Development Platform and GDB.Virgilvirgilia
As found here, only "C/C++ Remote Launch" is required to have "Launch group" feature. Optionnally, you can vote for Eclipse Bug 39900 in order to migrate this feature from CDT to platform.Doctorate
According to this answer CDT is no longer needed for Launch Group configurations.Cecil
C
49

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!

Cavorilievo answered 10/8, 2012 at 16:9 Comment(6)
This really doesn't seem like a "single package" to me. Through dependencies it also loads the entire C/C++ Development Platform and GDB.Virgilvirgilia
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.Cavorilievo
As found here, only "C/C++ Remote Launch" is required to have "Launch group" feature. Optionnally, you can vote for Eclipse Bug 39900 in order to migrate this feature from CDT to platform.Doctorate
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.Platte
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.Profanatory
Found out that setting Action to "Wait until terminated" does build sequentially :)Profanatory
R
42

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

Ransom answered 29/10, 2010 at 16:59 Comment(5)
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?Geniagenial
No hacking necessary. Just install "C/C++ Development Tools" from the CDT (see eclipse.org/cdt/downloads.php ) - this single package is enough to have "Launch Groups". Works for all kinds of projects, including Java projects.Cavorilievo
This really does not seem like a "single package" to me. Through dependencies it also loads the entire C/C++ Development Platform and GDB.Virgilvirgilia
As found here, only "C/C++ Remote Launch" is required to have "Launch group" feature. Optionnally, you can vote for Eclipse Bug 39900 in order to migrate this feature from CDT to platform.Doctorate
According to this answer CDT is no longer needed for Launch Group configurations.Cecil
D
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.

Deering answered 15/11, 2017 at 7:52 Comment(2)
It would be great if there is a way to share (join) the consoles from launchers in a single console.Salicin
Great idea. Please report it as a feature request (enhancement): bugs.eclipse.org/bugs/…Deering
V
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.

Virgilvirgilia answered 25/11, 2012 at 0:57 Comment(0)
S
-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");
    }
}
Snowberry answered 29/10, 2010 at 16:14 Comment(1)
This forces execution of all process in the same VM, which may be not desirableDoctorate
W
-4

You don't need any plugin:

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

Screenshot

Weems answered 14/10, 2012 at 11:11 Comment(1)
but that does not run them at once.Geniagenial

© 2022 - 2024 — McMap. All rights reserved.