Search code examples
intellij-ideajunitjunit4

Make IntelliJ IDEA run JUnit tests with -parameters javac option


Is there a way to ensure the -parameters option is passed whenever running JUnit tests from IntelliJ IDEA?
If it's impossible to set globally, it would even help to set it for specific Run/Debug configurations.


Solution

  • The -parameters option is a Java compiler option, so it affects how the code is compiled, not how it is run. You can add it in Settings | Build, Execution, Deployment | Compiler | Java Compiler | Additional command line parameters.