Eclipse command line arguments
- Click on Run -> Run Configurations
- Click on Arguments tab
- In Program Arguments section , Enter your arguments.
- Click Apply
It is sure to work cause I tried it in mine right before I wrote this answer
There is a situation (bug) where modifying the Run -> Run Configurations arguments does not work, since the actual run configuration being executed is actually hidden from you.
So updating the visible one will not be reflected in your actual run.
Example:
import static org.junit.Assert.assertEquals;
import org.junit.Test;
public class EclipseRunConfigurationTest {
@Test
public void test() {
assertEquals("foo", System.getProperty("runProperty"));
}
}
- Run it - it will fail.
- Modify the run configuration using the method specified by Little Child. add "-DrunProperty=foo" VM parameter
- Run it again - it will pass
- Debug it, then switch to the debug view,
- RClick the Junit launch -> Edit Rerun EclipseRunConfigurationTest...
- Change the VM parameter to "-DrunProperty=bar"
- Apply and Debug - it will fail
- Open the Run/Debug manager again
- Note that 'Rerun EclipseRunConfigurationTest' is not listed.
- Note that the VM parameter is still "-DrunProperty=foo"
- No amount of changing it makes the slightest bit of difference.
I shall file a bug report.
The above was run on Eclipse Kepler running on Fedora 20.