Set java system properties in IntelliJ or Eclipse

diegomontoyas picture diegomontoyas · Apr 5, 2015 · Viewed 63.4k times · Source

I have a project which runs correctly under the terminal command

mvn package exec:java -Dplatform.dependencies -Dexec.mainClass=Demo

Now, I need to debug it correctly (not terminal) with IntelliJ or Eclipse on Mac (preferably IntelliJ) but I have tried setting VM options in various places and nothing seems to work.

Where is the correct place to put these options: -Dplatform.dependencies -Dexec.mainClass=Demo?

Answer

Mzf picture Mzf · Apr 5, 2015

In InteliJ goto "Run"->"Edit Configurations" In the new window, right panel, open the Junit and click on your test. Now, in the middle click on the "Configuration" tab and update the "VM options"

Note that you will need to do this for every test class, but you can remove all the test from the junit in the right panel and update it in the "Defaults"