[eclipse] How do I get the command-line for an Eclipse run configuration?

I have several JUnit run configurations in Eclipse that I need to replicate on the command-line in order to use a third-party analysis tool. So far I've just been writing the command-line manually by looking at the run configuration and writing the appropriate classpath and command-line arguments.

Eclipse's run configurations (normal, JUnit, or other) must ultimately boil down to a command-line anyway, so how and where do I find that?

This question is related to eclipse

The answer is


Scan your workspace .metadata directory for files called *.launch. I forget which plugin directory exactly holds these records, but it might even be the most basic org.eclipse.plugins.core one.


You'll find the junit launch commands in .metadata/.plugins/org.eclipse.debug.core/.launches, assuming your Eclipse works like mine does. The files are named {TestClass}.launch.

You will probably also need the .classpath file in the project directory that contains the test class.

Like the run configurations, they're XML files (even if they don't have an xml extension).