4

Eclipse is creating a new "Run Configuration" every time that I execute a Scala program. The problem with this is that I need to customize the default Run Configuration (need to change the working path). So the first time I create and customize a Run Configuration everything works fine, but any subsequente attempts to run the Scala file with "Run As" -> "Scala application" will fail since my custom settings are lost and the Scala program is executed with a new default Run Configuration.

The following figure illustrates how the "Run Configurations" dialog looks like after executing my scala application three times. Only the first Run Configuration has the desired settings:

enter image description here

How can I configure Eclipse to use always the same Run Configuration when running the same Scala file ? (I mean, without having to open the the "Run Configurations..." dialog every time).

om-nom-nom
  • 62,329
  • 13
  • 183
  • 228
Sergio
  • 8,532
  • 11
  • 52
  • 94

3 Answers3

2

Set in Eclipse preferences Run/Debug > Launching -> Launch Operation to Always launch the previously launched application.

Appleshell
  • 7,088
  • 6
  • 47
  • 96
0

You actually shouldn't use "Run as" option every time. Just press run button (green circle with arrow) and select correct configuration to run.

It Should work.

vinothp
  • 9,939
  • 19
  • 61
  • 103
  • it does not help, if I press the run button it is still creating a new "Run Configuration" and ignoring the one that is already there. So the execution fails since I need it to be executed in the working path as specified in my custom Run configuration. When running a Java class I do not have that problem BTW, it will take an existing Run Configuration instead of creating a new default one. Puzzled about why that behavior is different with Scala. – Sergio Nov 01 '12 at 20:05
  • Indeed eclipse have different behaviour on different platforms. On my linux box run button executes last configuration, otherwise on windows box it just stuck on "Run as" option. Try press down arrow next to run button it should display pop up menu with a list of possible options including existing run configurations. – Serge Ivanov Nov 02 '12 at 05:06
0

Go to the Scala perspective in OSX Eclipse. Click the triangle next to the Run toolbar button to see the drop-down menu for the Run button. Choose "Organize Favorites..." and select one or more run configurations as a favorite.

When one or more favorites are selected, then clicking the Run button executes the last favorited run configuration that was executed instead of creating a new run configuration.

jeff
  • 129
  • 3