How to define default JVM arguments in IDEA?

Philipp Claßen picture Philipp Claßen · Sep 9, 2015 · Viewed 19.1k times · Source

Is there an option to define default JVM arguments in IntelliJ IDEA?

For example, I would like to always activate:

  • -ea -Dslf4j.detectLoggerNameMismatch=true

In Eclipse, the option can be found in:

  • Preferences -> Java -> Installed JREs -> Edit -> Default VM arguments

Answer

yshavit picture yshavit · Sep 9, 2015

You have to do it per run type (Application, JUnit test, etc).

In the "edit configurations" window ("Run" ▸ "Edit Configurations..."), expand the "Defaults" item, select the appropriate run type, and edit its defaults in the left pane.

The full documentation is available in the IDEA docs.