Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

eclipse

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?

like image 665
rob Avatar asked Dec 31 '13 18:12

rob


People also ask

How do I get the command line in Eclipse?

A fully working command-line Terminal inside Eclipse. Just press Ctrl+Alt+T to open a local command prompt (Terminal).

How do I get to the run configuration in Eclipse?

Creating and Using a Run Configuration The Run Configuration dialog can be invoked by selecting the Run Configurations menu item from the Run menu. A name for the run configuration.

Where is Eclipse Runtime config?

In the Eclipse menu bar, click Run > Run Configurations. In the Run Configurations dialog box, click Java Application in the left pane. Click the New launch configuration icon in the left upper corner. By default, Eclipse names the run configuration after the name of your Java class.

How do I run a Java program from the command line in Eclipse?

In Eclipse, select File → Export, then Java → Runnable JAR File. Launch Configuration identifies which program should be exported. Find the one that runs the class containing your main() method. Export Destination is the name and location of the JAR file you want to generate.


1 Answers

I found a solution on Stack Overflow for Java program run configurations which also works for JUnit run configurations.

You can get the full command executed by your configuration on the Debug tab, or more specifically the Debug view.

  1. Run your application
  2. Go to your Debug perspective
  3. There should be an entry in there (in the Debug View) for the app you've just executed
  4. Right-click the node which references java.exe or javaw.exe and select Properties In the dialog that pops up you'll see the Command Line which includes all jars, parameters, etc
like image 153
rob Avatar answered Oct 05 '22 11:10

rob