Top community members
All Questions Ask Question

Welcome to Dirask IT community! ā¤ šŸ’»
We are community that shares solutions with each other.

If you think you have something to add here.

you are welcome with your fresh ideas - List Articles

JUnit 5 error Process finished with exit code -1 - can't run unit test from Intellij idea

1 answers
2 points

I included JUnit 5 mavenĀ dependency to my new project and created first test.

I can't start my unit test class, because I get error inĀ Intellij idea:

Process finished with exit code -1

Screenshot of error:

Unit test:

package logic;

import org.junit.jupiter.api.Test;

public class InitTest {

    @Test
    public void test1() {
        System.out.println("a");
    }
}

Maven dependency:

<dependency>
    <groupId>org.junit.jupiter</groupId>
    <artifactId>junit-jupiter-api</artifactId>
    <version>5.6.2</version>
</dependency>
<dependency>
    <groupId>org.junit.jupiter</groupId>
    <artifactId>junit-jupiter-engine</artifactId>
    <version>5.5.2</version>
</dependency>
<dependency>
    <groupId>org.junit.platform</groupId>
    <artifactId>junit-platform-runner</artifactId>
    <version>1.5.2</version>
</dependency>
<dependency>
    <groupId>org.junit.jupiter</groupId>
    <artifactId>junit-jupiter-params</artifactId>
    <version>5.5.2</version>
</dependency>

How to solve this problem?

1 answers
2 points

You just need to use the same version of JUnit 5, the problem is with your first dependency version:

<dependency>
    <groupId>org.junit.jupiter</groupId>
    <artifactId>junit-jupiter-api</artifactId>
    <version>5.6.2</version>
</dependency>

Change it to the same version like the other 2 (junit-jupiter-engine and junit-jupiter-params) - version 5.5.2

This should fix the problem:

<dependency>
    <groupId>org.junit.jupiter</groupId>
    <artifactId>junit-jupiter-api</artifactId>
    <version>5.5.2</version>
</dependency>

Always try to use same release version of library.

0 comments Add comment

Checkout latest Findings & News:

Checkout latest questions:

Checkout latest wiki articles:

Hey šŸ‘‹
Would you like to know what we do?
  • Dirask is IT community, where we share coding knowledge and help each other to solve coding problems.
  • We welcome everyone,
    no matter what the experience,
    no matter how basic the question is,
    this community will help you.
Read more