Coverage tool: no longer finds class file within jar. #220

wknorr opened this Issue Oct 20, 2015 · 2 comments


None yet

2 participants

wknorr commented Oct 20, 2015

I get the following error when trying to get coverage information for a test application when the classes are in a jar file when using jmockit-coverage 1.19:

JMockit: No classes were instrumented for coverage; please make sure that classes selected for coverage through the regular expression "*" are available from the runtime classpath, and that they have been compiled with debug information.

The information is correctly generated when I use jmockit-coverage 1.16 or other earlier versions.
It is also correctly generated if I have the class files outside the jar.

The application simply prints a message and waits for the user to press enter.

Steps to reproduce:

  1. Compile the project: "mvn install".
  2. Run the application from the command line with the following command:
    "C:\Program Files\Java\jdk1.8.0_60\bin\java.exe" -classpath ./target/TestApp-1.0-SNAPSHOT.jar -javaagent:./target/runtimejars/jmockit-coverage.jar -Dcoverage-outputDir=./CodeCoverageReports* -Dcoverage-metrics=line -Dcoverage-output=html-nocp
  3. While the application is waiting for the user, attempt to generate code coverage information:
  • Open jconsole.
  • Connect to com.qhrtech.emr.testapp.TestApp .
  • Go to the MBeans tab.
  • Select JMockit Coverage->Coverage Control->Operations->generateOutput.
  • Click the generateOutput button.
    In the command window, the "No classes instrumented..." message is printed.

No output files are created in the output directory, CodeCoverageReports.

jmockit-coverage: 1.19 (from the Maven central repository)
Maven: 3.3.3
Java: JDK 1.8.0 u60

Source code:
===== src/main/java/com/qhrtech/emr/qa/testapp/ =====


import java.util.Scanner;

public class TestApp {

    public static void main( String[] args ) {

        System.out.println( "Press enter." );
        Scanner keyboard = new Scanner( );




<?xml version="1.0" encoding="UTF-8"?>
 <project xmlns="" xmlns:xsi="" xsi:schemaLocation="">
@rliesenfeld rliesenfeld added the bug label Oct 21, 2015
@rliesenfeld rliesenfeld self-assigned this Oct 21, 2015
wknorr commented Oct 26, 2015

Thanks for working on this.

I updated my pom file to bring in jmockit-coverage version 1.20 from the Maven Central Repository, which looks like it has your fix, but I still get the same error.

From: Rogério Liesenfeld []
Sent: Friday, October 23, 2015 6:16 PM
To: jmockit/jmockit1
Cc: Wayne Knorr
Subject: Re: [jmockit1] Coverage tool: no longer finds class file within jar. (#220)

Closed #220#220 via a718931a718931.

Reply to this email directly or view it on GitHub


A bug related to classes from jars was fixed, but there was another one. Issue #229 was open for it now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment