4.1. IDE Support

4.1.1. IntelliJ IDEA

IntelliJ IDEA supports running tests on the JUnit Platform since version 2016.2. For details please see the post on the IntelliJ IDEA blog. Note, however, that it is recommended to use IDEA 2017.3 or newer since these newer versions of IDEA will download the following JARs automatically based on the API version used in the project: junit-platform-launcher, junit-jupiter-engine, and junit-vintage-engine.

IntelliJ IDEA releases prior to IDEA 2017.3 bundle specific versions of JUnit 5. Thus, if you want to use a newer version of JUnit Jupiter, execution of tests within the IDE might fail due to version conflicts. In such cases, please follow the instructions below to use a newer version of JUnit 5 than the one bundled with IntelliJ IDEA.

In order to use a different JUnit 5 version (e.g., 5.7.0), you may need to include the corresponding versions of the junit-platform-launcher, junit-jupiter-engine, and junit-vintage-engine JARs in the classpath.

Additional Gradle Dependencies

  1. // Only needed to run tests in a version of IntelliJ IDEA that bundles older versions
  2. testRuntimeOnly("org.junit.platform:junit-platform-launcher:1.7.0")
  3. testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.7.0")
  4. testRuntimeOnly("org.junit.vintage:junit-vintage-engine:5.7.0")

Additional Maven Dependencies

  1. <!-- Only needed to run tests in a version of IntelliJ IDEA that bundles older versions -->
  2. <dependency>
  3. <groupId>org.junit.platform</groupId>
  4. <artifactId>junit-platform-launcher</artifactId>
  5. <version>1.7.0</version>
  6. <scope>test</scope>
  7. </dependency>
  8. <dependency>
  9. <groupId>org.junit.jupiter</groupId>
  10. <artifactId>junit-jupiter-engine</artifactId>
  11. <version>5.7.0</version>
  12. <scope>test</scope>
  13. </dependency>
  14. <dependency>
  15. <groupId>org.junit.vintage</groupId>
  16. <artifactId>junit-vintage-engine</artifactId>
  17. <version>5.7.0</version>
  18. <scope>test</scope>
  19. </dependency>

4.1.2. Eclipse

Eclipse IDE offers support for the JUnit Platform since the Eclipse Oxygen.1a (4.7.1a) release.

For more information on using JUnit 5 in Eclipse consult the official Eclipse support for JUnit 5 section of the Eclipse Project Oxygen.1a (4.7.1a) - New and Noteworthy documentation.

4.1.3. NetBeans

NetBeans offers support for JUnit Jupiter and the JUnit Platform since the Apache NetBeans 10.0 release.

For more information consult the JUnit 5 section of the Apache NetBeans 10.0 release notes.

4.1.4. Visual Studio Code

Visual Studio Code supports JUnit Jupiter and the JUnit Platform via the Java Test Runner extension which is installed by default as part of the Java Extension Pack.

For more information consult the Testing section of the Java in Visual Studio Code documentation.

4.1.5. Other IDEs

If you are using an editor or IDE other than one of those listed in the previous sections, the JUnit team provides two alternative solutions to assist you in using JUnit 5. You can use the Console Launcher manually — for example, from the command line — or execute tests with a JUnit 4 based Runner if your IDE has built-in support for JUnit 4.