Anyone know how to get Eclipse to use a set of default VM args? I'm getting fed up of constantly having to specify these manually every time I run a specific package, class or method within my otherwise smoothly-running test suite.
Using JUnit 4, Eclipse 3.5.
Rationale: some tests are integration tests verifying operations with large input sets so it's tedious to have to keep putting in:
-Xms256m -Xmx512m
If there's something, e.g. in Eclipse prefs, where I can specify this once and for all I'd be very grateful!
-- Go to the Eclipse Window > preferences, in "Java > Installed JREs". -- Copy the current default JRE with a new name, for example myJRE. -- Select the new JRE and click on the "Edit" button. -- In the "Edit JRE" dialog, add your JVM arguments in the "Default VM Arguments" field.
Run-> Run Configurations -> JUnit, select your run configuration, then you have an arguments tab to specify JVM or program arguments. You can then duplicate this run configuration to use for other tests.
Step 1: Open the IDE and right-click on the application in which you want to pass VM arguments. Step 2: Click on the Run As » Run Configurations… Step 3: Click on the Arguments tab and in the VM arguments: box, type the arguments that you want to pass.
If you run your tests in a separate JRE (the default, I think) then you can go to Installed JREs and specify default VM arguments for it there, as in the screenshot below (the orange buttons indicate what I clicked to access the dialog below it).
If you run your tests in the same JRE as the workspace, then the solution is to edit your eclipse.ini file and put the arguments there.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With