How to Solve IDEA Error: “Library source does not match the bytecode for class”

problem description

After jar package is updated, an error message is reported: “library source does not match the bytecode for class”

After checking, it is found that jar content is still the old version

The jar package management tool is gradle


1. Update jar package through gradle command, refresh dependencies: gradle clean dependencies — refresh dependencies, and then,


If not, use the next method

2.File–> Invalidate caches/restart to clean up compiler cache


If there is still no effect, please look at the next solution

3. Find the jar package local warehouse of gradle, delete all the downloaded jar package versions and download them again

local warehouse Path, first confirm whether you are using the gradle that comes with idea or your own

Go directly to the folder e: repo \. Gradle/caches/modules-2/files-2.1

Similar Posts: