Charles
Charles

Reputation: 11

How to use a launch configuration as a template in eclipse

Is there a way to use a launch configuration in eclipse as a "template" such that I can just right click the java file containing the main class and run/debug it?

Launch configuration:

https://i.sstatic.net/tAr1K.png

I want to use this for running tests (we do not use any frameworks like JUnit) which are all in separate java files. The launch configurations mainly have different environments (particularly the environment variables set) to control whether to run the test with logging/tracing on, etc. Right now, in order to run different tests using different environment variables, I have to keep changing the main class based on the test I want to run.

Upvotes: 1

Views: 881

Answers (1)

flaxel
flaxel

Reputation: 4587

Yes it is possible. You can create a prototype as a template. There are several steps necessary:

  1. create a prototype configuration
  2. create a configuration
  3. select the prototype tab + set the prototype
  4. at the end it should look like this and you can set some attributes

enter image description here

Upvotes: 1

Related Questions