Jacoco java.lang.instrument.IllegalClassFormatException: Error while instrumenting Class

Viewed 8446

I recently moved to another computer and needed to reset all my environment.

So, this tests was working before.

But I didnt remember which version of Java/JDK I was using before.

Well, the problem is:

java.lang.instrument.IllegalClassFormatException: Error while instrumenting path/to/class

I'm using Jacoco "0.8.1"

java --version
openjdk 17.0.1 2021-10-19

and JDK 1.8

Can anyone know how to handle with it?

1 Answers

Strange to see statement

and JDK 1.8

together with

java --version
openjdk 17.0.1 2021-10-19

from the last one seems that actually you're using JDK 17

I'm using Jacoco "0.8.1"

We (developers of JaCoCo) advice to always use latest released version as new versions come with fixes and improvements (IMO updating versions of your dependencies and tools - is a very good practice also in general), so please try this - as of today latest released JaCoCo version is 0.8.7, and exactly in this version JDK 17 support was added.

Related