Home > Blockchain >  Java NoClassDefFoundError in a simple project
Java NoClassDefFoundError in a simple project

Time:11-08

I'm quite a beginner in Java and I'm getting

java.lang.NoClassDefFoundError: org/hamcrest/SelfDescribing

error in a really simple Java program in a test class (RomanTest) and I have no idea how to solve the problem.

What can be the cause of the error and how to repair it? I'm using IntelliJ IDEA.

Link for downloading .zip containing my project: https://ufile.io/f0erfyon

CodePudding user response:

You should not work with such outdated version of JUnit. For example use at least one of the lastest release version of the 4'er junit in your pom

<dependency>
    <groupId>junit</groupId>
    <artifactId>junit</artifactId>
    <version>4.12</version>
</dependency>

CodePudding user response:

Ok, I finally found an answer:

I had to update IntelliJ IDEA to the newest release and use newer version of JUnit. That solved the problem.

  • Related