24

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
Philipp Claßen
  • 41,306
  • 31
  • 146
  • 239
  • http://stackoverflow.com/questions/14928534/how-do-i-make-intellij-use-jvm-options-for-all-main-files-in-a-project – kupsef Sep 09 '15 at 16:20

3 Answers3

28

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.

yshavit
  • 42,327
  • 7
  • 87
  • 124
3

You can set your VM options for all applications as a default by picking the application type (for command line Java programs it would be 'Application') under the 'Templates' tree found via the menu items Run/Edit Configurations... Then all new applications you create will use that default. Older versions of IntelliJ IDEA labeled that tree 'Defaults'.

Alz
  • 1,520
  • 1
  • 11
  • 10
2

This is the field in the Run/Debug Configurations dialog you need to edit:

enter image description here

OneWorld
  • 17,512
  • 21
  • 86
  • 136