How to define default JVM arguments in IDEA?
Asked Answered
K

3

25

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
Kakalina answered 9/9, 2015 at 16:8 Comment(1)
#14929034Rider
P
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.

Pone answered 9/9, 2015 at 16:15 Comment(3)
Tnx! Saved me tons of time.Whop
In the new versions it is called Templates - just for reference :)Agape
document link was 404edExeter
P
4

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

Premeditation answered 11/11, 2018 at 14:47 Comment(0)
V
2

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

enter image description here

Vaquero answered 16/5, 2018 at 11:18 Comment(1)
This won't create a default unless you do it under a Template, rather than an individual run configuration.Similar

© 2022 - 2024 — McMap. All rights reserved.