When compiling a project, Maven throws an error
OS Linux - Ubuntu 20.04.2 LTS When compiling a project, Maven throws an error
[ERROR] Error executing Maven.
[ERROR] java.lang.IllegalStateException: Unable to load cache item
[ERROR] Caused by: Unable to load cache item
[ERROR] Caused by: Could not initialize class com.google.inject.internal.cglib.core.$MethodWrapper
java -version
openjdk version "17" 2021-09-14 LTS
OpenJDK Runtime Environment (build 17+35-LTS)
OpenJDK 64-Bit Server VM (build 17+35-LTS, mixed mode, sharing)
mvn -version
Apache Maven 3.6.3
Maven home: /usr/share/maven
Java version: 17, vendor: BellSoft, runtime: /usr/lib/jvm/bellsoft-java17-amd64
Default locale: ru_RU, platform encoding: UTF-8
OS name: "linux", version: "5.11.0-37-generic", arch: "amd64", family: "unix"
java -XshowSettings:properties -version 2>&1 > /dev/null | grep 'java.home'
java.home = /usr/lib/jvm/bellsoft-java17-amd64
Same issue i also faced.And i got the solution. Update latest maven version which is 3.8.3. With latest maven it is working.
mvn -v Apache Maven 3.8.3 (ff8e977a158738155dc465c6a97ffaf31982d739) Maven home: /opt/maven Java version: 17, vendor: Private Build, runtime: /usr/lib/jvm/java-17-openjdk-amd64 Default locale: en_IN, platform encoding: UTF-8 OS name: "linux", version: "5.10.0-1051-oem", arch: "amd64", family: "unix"