Getting Error on Using JMockit: Could not initialize class mockit.coverage.Metrics

741 views Asked by At

I am running a Jenkins job that build a package. However all the tests are failing with the following errors:

**Error Message** :
   Could not initialize class mockit.coverage.Metrics
**Stacktrace** :
   java.lang.NoClassDefFoundError: Could not initialize class mockit.coverage.Metrics

Pom dependency:

<dependency>
            <groupId>org.jmockit</groupId>
            <artifactId>jmockit</artifactId>
            <version>1.24</version>
            <scope>test</scope>
</dependency>
1

There are 1 answers

0
Jeff Bennett On

Why are you using jmockit 1.24 (May 2016) and not the current version? It's quite likely you have stumbled into some old bug long since fixed. Upgrade.

http://jmockit.github.io/changes.html