18

I have a run configuration defined for my Eclipse RCP application which is saved to a .launch file. Is there a way to use this launch configuration outside the Eclipse IDE? i.e, it would be nice to be able to launch the application from the command line for continuous integration purposes.

3 Answers 3

9

You can get the command line Eclipse uses:

  1. Run your program in Eclipse
  2. Go to the "Debug" view
  3. Right-click on the process (probably the second item in the tree) and select "Properties"
  4. Copy shell command and delete the agentlib flag to run in bash. Unfortunately, you need to do this whenever you change the configuration.
3
  • 2
    I don't think this answers the question at all. He asked if the launch configuration can be launched via command line i.e. in a batch file. Aug 10, 2015 at 8:05
  • You can get the command line used by Eclipse to launch the application with these steps. There is still the problem of having to update your script whenever your configuration changes, but it works. Aug 10, 2015 at 23:34
  • Sorry my bad, I understood your answer incorrectly. Aug 11, 2015 at 8:46
1

Yes, you could create and export a product configuration based on your launch-configuration:

  1. Create new Product Configuration (File -> New -> Other)
  2. Name the file (e.g. myrcp.product)
  3. Select "Use a launch configuration" on the first page of the wizard

The product editor should open automatically. In the Exporting section you should be able to export your product using the "Eclipse Product export wizard".

Resource: Eclipse FAQ - How can I deploy my RCP app

Have a look at this PDE Build tutorial. It explains how to build and test (or run) your product using Ant.

2
  • I was asking about how to run a launch configuration outside of Eclipse, i.e. headless environment. Note that creating a product configuration based on a launch configuration only works for launch configurations for 'Eclipse applications'.
    – lucks
    Apr 26, 2011 at 23:08
  • 1
    @lucks I don't think I understood you correctly. you wrote "I have a run configuration defined for my Eclipse RCP application". However, if you are searching for a way to call your launch configuration programmatically, then this question might be a duplicate of How to run Eclipse launch configurations programmatically?
    – eldn
    Apr 27, 2011 at 11:28
0

It is possible to do that with a little workaround. You can find your configuration at workspace\.metadata\.plugins\org.eclipse.debug.core\.launches.
So, open it in text editor and find an attribute containing goals, e.g. clean install -DskipTests=true.
Then, go to the root of your project and execute that by the CMD:

mvn clean install -DskipTests=true

This should be similar for other goals.

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.