CLI tool
jacoco/jacoco avatar
jacoco/jacoco

JaCoCo: coverage measured on the bytecode rather than the source

:microscope: Java Code Coverage Library

4,620 stars1,200 forksJavaNOASSERTION

At a glance

What is it?
The free Java code coverage library, with validation suites for Java versions from java5 to java28 plus Kotlin, Scala and Groovy.
Who is it for?
JaCoCo's real subject is not the coverage percentage but the gap between your source and the bytecode the compiler produced from it. Every module in the repository is organised around that gap, which is why the repository carries a validation suite per language version.
Can I use it commercially?
Check first. The repository uses a licence we do not classify automatically, so read its LICENSE file before any commercial use.
Is it still maintained?
Yes. The repository received new commits within the last day.
What is it written in?
Mainly Java, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on November 22, 2026, and from our analysis. They are not legal advice.

From daily snapshots

Star history

  • jacoco/jacoco4,620 ★ · +13
Star history
Repository2026-10-072026-11-22
jacoco/jacoco4.6k4.6k

13 Stars in the last 46 days, measured from the daily GitHub snapshot. Compare with other projects

Editorial analysis

Coverage computed on class files, not on source text

JaCoCo is a Java code coverage library, and the interesting decision is one it made long ago: it instruments bytecode rather than trying to observe source lines.

That choice has consequences in both directions. Because the unit of measurement is the class file, JaCoCo is not tied to a particular build tool or a particular compiler plugin, and it sees everything the JVM will actually execute, including code a language-level tool might miss. The cost is that the compiler emits instructions for things you did not write. Lambdas, default arguments, inline classes, switch statements and annotation-driven helpers all become branches in the bytecode, and a naive reading of those instructions produces coverage numbers that look wrong.

A README that is a directory rather than a manual

The JaCoCo README is short, and it is short on purpose. It names the project, states that it is a free Java code coverage library distributed under the Eclipse Public License, and then offers a list of starting points keyed to intent: I want to use JaCoCo, I want to know how JaCoCo works, I have a question, I found a bug, I have an idea.

The use path fans out to a download page and four build-specific pages for Maven, Ant, the command line interface, and other integrations. The understand path goes to the documentation. The question path offers an FAQ, the documentation, and a Google Groups user forum. Bugs go to a GitHub issue template, and ideas go to the user forum or a GitHub feature request.

Nothing else is in the file. There is no install snippet, no sample report and no configuration example. What you can say is where the project expects you to go for each kind of question, and that division is deliberate.

Two badges are worth reading for the operational picture. The build badge points at Azure Pipelines on the master branch, and the second badge points at Maven Central for the org.jacoco namespace, which is where the artifacts actually live for anyone not building from source.

Six modules and a validation suite per language

The repository tree is laid out as one directory per Maven module, each with a matching test module. Reading the names tells you the architecture.

`org.jacoco.agent` is the part that runs in your JVM, and it has a sibling runtime module, `org.jacoco.agent.rt`, for the code the agent needs at runtime. `org.jacoco.core` is the analysis engine: it reads class files and works out what to probe. `org.jacoco.report` consumes that analysis and produces output. `org.jacoco.cli` is the command line front end, and `org.jacoco.ant` and `jacoco-maven-plugin` are the two build tool integrations the project ships itself. There is also `org.jacoco.doc` for the documentation site and `org.jacoco.build` for build tooling.

The `org.jacoco.core.test.validation.*` directories are the part worth slowing down on. There is one per language or version the project claims to handle correctly: java5, java7, java8, java14, java16, java21, java22, java25, java27, java28, plus kotlin, scala and groovy. Each is a separate validation suite.

That structure is the project's answer to the hard question. Coverage correctness is not a single claim but a claim per construct, and a new validation module for a new Java version is the artifact that makes the support claim testable. Note the range the directories already span: java27 and java28 have validation directories.

There is also `org.jacoco.benchmarks`, which is a reminder that instrumentation has a runtime cost someone is actively measuring, and `org.jacoco.tests`.

Three releases a year, each one chasing a Java version

The release cadence explains the shape of the project better than any feature list would. Version 0.8.14 was published on 2025-10-11, version 0.8.15 on 2026-06-05 and version 0.8.16 on 2026-10-26.

With 4,613 stars, 1,199 forks and 247 open issues, this is a dependency that many teams would notice breaking before they noticed it working.

The last push was on 2026-11-01, so the master branch is active. Whether a given Java version is officially supported is answered by the release notes for the version you are on, not by the branch you are reading, which is the practical reason to check the release page rather than the repository.

What the project leaves to its own documentation

Because the README delegates, the honest gaps are worth naming. Nothing on the repository page tells you how to configure exclusion filters, how to merge coverage from several execution units, or how the report formats differ from each other. All of that lives in the documentation the README links, and the FAQ is the page to read first because filters are where most coverage arguments are settled.

Nothing tells you how JaCoCo behaves under a particular test runner or in a particular container either, since the integrations page exists precisely because those combinations vary. And nothing states a license in the repository metadata; the README's own sentence is the claim, and it names the Eclipse Public License, with a LICENSE.md at the repository root.

For an evaluation, the practical sequence is short. Read the download page to pick an artifact, read the page for your build tool, and then read the filters documentation before trusting any number your build produces. If you are interested in how a specific language construct is measured, the validation modules named after that language version are the part of the repository that answers it directly.

Editorial conclusion

JaCoCo's real subject is not the coverage percentage but the gap between your source and the bytecode the compiler produced from it. Every module in the repository is organised around that gap, which is why the repository carries a validation suite per language version. If you are choosing a coverage tool, the deciding question is whether you can accept numbers computed on class files, because that is what makes JaCoCo independent of your build system and of your language's compiler. The repository itself is thin documentation, so the starting point is the download page and then the plugin page for your build, the FAQ for the report filters, and the validation modules if you want to see how a given construct is treated. License is worth confirming for your organisation: the README states JaCoCo is distributed under the Eclipse Public License and the repository carries a LICENSE.md, but the repository metadata itself reports no asserted license identifier.

Frequently asked questions

What is JaCoCo used for?

JaCoCo measures test coverage for Java code. The repository ships an agent, a core analysis module, a report module, a CLI, an Ant integration and a Maven plugin.

How does JaCoCo calculate coverage?

It works on class files rather than source lines. The agent module runs inside the JVM, the core module reads class files and works out what to probe, and the report module turns the collected execution data into a report. Because the unit is the class file, bytecode your compiler generated for its own purposes has to be filtered out, which is what the project's validation modules test.

Which module produces the report?

The report module. The tree separates the runtime pieces, the analysis engine in `org.jacoco.core`, and output generation in `org.jacoco.report`, with the command line and the Ant and Maven plugins sitting on top as front ends.

How do I know whether my Java version is supported?

Check the release notes for the JaCoCo version you are actually running. The latest release is 0.8.16 from 2026-10-26, and the validation modules show which Java versions the project tests.

Why do my coverage numbers include code I never wrote?

Because JaCoCo measures bytecode, and compilers emit instructions for language constructs rather than for lines you typed. Lambdas, default arguments, inline value classes and switch lowering all show up.

Official sources

  1. Issues
  2. jacoco/jacoco on GitHub
  3. Project website
  4. README
  5. Releases
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/jacoco-jacoco.svg)](https://hysenlabs.com/projects/jacoco-jacoco)

Star history chart for your README

markdown
[![Star history](https://hysenlabs.com/chart/jacoco-jacoco.svg)](https://hysenlabs.com/projects/jacoco-jacoco)

Was this useful?