2

I have a main class that takes a series of arguments and I have 10 run configurations. Is there a way to have eclipse run them one after another?

asked Jul 9, 2012 at 20:47
6
  • Create a batch file that runs your software with each of the different run configurations? Commented Jul 9, 2012 at 20:50
  • 1
    Write an ant/maven script to run the program the way you want or modify the scripts you already have on your project. Commented Jul 9, 2012 at 20:52
  • 2
    Tom is right, ANT is a good way to go, see for example here Commented Jul 9, 2012 at 20:54
  • I thought ant was for building applications? For reasons to long to explain I can't export the project to a runnable jar and I need to run it through eclipse. So I click each run config and wait till it is done, then click the next... Commented Jul 9, 2012 at 20:57
  • @StevenFeldman both ant and maven allow you to execute tasks/goals defined in your scripts. They can be as complex as compiling the entire project, running a set of unit and integration tests, deploying the application to production, testing again and then pushing it to version control. Eclipse lets you execute them goals in a couple of clicks as well. It's not a problem to define a task/goal of running an application ten times with different settings in either of these technologies. Commented Jul 9, 2012 at 21:01

3 Answers 3

2

The other answers are probably better solutions to your problem. However, if you install the Eclipse CDT into your Eclipse installation (using update manager or market place client), then you get an additional launch configuration type called Launch group.

Those launch groups allow creating a list of other launch configurations to be run one after the other. Make sure to set the Post build action in the dialog to "Wait until terminates" for each included launch configuration.

answered Jul 10, 2012 at 6:00
Sign up to request clarification or add additional context in comments.

Comments

1

@Steven: To do it quick, you can write a JUnit Test case that just calls the intended classes in desired order and execute it. Eclipse already has the necessary jar for JUnit, so you are ready to go. Definitely, writing ANT/MAVEN script is a good practice.

answered Jul 9, 2012 at 21:53

Comments

0

As @gotuskar suggested, write test cases for your class. If you can afford running your ten configurations each time you build your project put them in its src/test/java directory, otherwise create a sibling project to your original one, make it depend on it, and put your tests there.

answered Jul 9, 2012 at 22:10

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.