Search code examples
javaintellij-ideajvm-arguments

How to define default JVM arguments in IDEA?


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

Solution

  • 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.