title: Maven - NoSuchMethodError: void com.google.common.base.Preconditions.checkArgument(boolean, java.lang.String, java.lang.Object)
body: <p>I'm facing an issue with Maven and Java 16.</p>
  <h2>The Problem</h2>
  <p>When I'm trying to package my project with maven <code>mvn package</code>, I got this error:</p>
  <pre class="lang-xml prettyprint-override"><code>[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
  </code></pre>
  <p>Following the solution brought by <a href="https://www.mail-archive.com/pkg-java-maintainers@alioth-lists.debian.net/msg15686.html" rel="nofollow noreferrer">this website</a>, I have modified the symlink:</p>
  <p>Before modification</p>
  <pre class="lang-sh prettyprint-override"><code># ll /usr/share/maven/lib | grep guice
  guice.jar -&gt; ../../java/guice.jar
  </code></pre>
  <p>Application of the fix</p>
  <pre class="lang-sh prettyprint-override"><code># sudo ln -s --force ../../java/guice-4.2.1-no_aop.jar guice.jar
  </code></pre>
  <p>After modification</p>
  <pre class="lang-sh prettyprint-override"><code># ll /usr/share/maven/lib | grep guice
  guice.jar -&gt; ../../java/guice-4.2.1-no_aop.jar
  </code></pre>
  <p>However, this leads to a new error:</p>
  <pre><code># mvn
  ---------------------------------------------------
  constituent[0]: file:/usr/share/maven/conf/logging/
  constituent[1]: file:/usr/share/maven/lib/maven-resolver-transport-wagon.jar
  constituent[2]: file:/usr/share/maven/lib/maven-core-3.x.jar
  constituent[3]: file:/usr/share/maven/lib/guava.jar
  constituent[4]: file:/usr/share/maven/lib/maven-compat-3.x.jar
  constituent[5]: file:/usr/share/maven/lib/guice.jar
  constituent[6]: file:/usr/share/maven/lib/maven-repository-metadata-3.x.jar
  constituent[7]: file:/usr/share/maven/lib/maven-slf4j-provider-3.x.jar
  constituent[8]: file:/usr/share/maven/lib/commons-io.jar
  constituent[9]: file:/usr/share/maven/lib/commons-cli.jar
  constituent[10]: file:/usr/share/maven/lib/jansi.jar
  constituent[11]: file:/usr/share/maven/lib/maven-settings-3.x.jar
  constituent[12]: file:/usr/share/maven/lib/wagon-http-shaded.jar
  constituent[13]: file:/usr/share/maven/lib/maven-model-3.x.jar
  constituent[14]: file:/usr/share/maven/lib/maven-resolver-impl.jar
  constituent[15]: file:/usr/share/maven/lib/wagon-file.jar
  constituent[16]: file:/usr/share/maven/lib/sisu-inject.jar
  constituent[17]: file:/usr/share/maven/lib/commons-lang3.jar
  constituent[18]: file:/usr/share/maven/lib/plexus-interpolation.jar
  constituent[19]: file:/usr/share/maven/lib/maven-model-builder-3.x.jar
  constituent[20]: file:/usr/share/maven/lib/cdi-api.jar
  constituent[21]: file:/usr/share/maven/lib/maven-artifact-3.x.jar
  constituent[22]: file:/usr/share/maven/lib/maven-resolver-api.jar
  constituent[23]: file:/usr/share/maven/lib/slf4j-api.jar
  constituent[24]: file:/usr/share/maven/lib/plexus-sec-dispatcher.jar
  constituent[25]: file:/usr/share/maven/lib/wagon-provider-api.jar
  constituent[26]: file:/usr/share/maven/lib/maven-resolver-spi.jar
  constituent[27]: file:/usr/share/maven/lib/maven-settings-builder-3.x.jar
  constituent[28]: file:/usr/share/maven/lib/plexus-component-annotations.jar
  constituent[29]: file:/usr/share/maven/lib/aopalliance.jar
  constituent[30]: file:/usr/share/maven/lib/plexus-utils.jar
  constituent[31]: file:/usr/share/maven/lib/javax.inject.jar
  constituent[32]: file:/usr/share/maven/lib/maven-shared-utils.jar
  constituent[33]: file:/usr/share/maven/lib/maven-resolver-provider-3.x.jar
  constituent[34]: file:/usr/share/maven/lib/maven-resolver-connector-basic.jar
  constituent[35]: file:/usr/share/maven/lib/maven-resolver-util.jar
  constituent[36]: file:/usr/share/maven/lib/maven-embedder-3.x.jar
  constituent[37]: file:/usr/share/maven/lib/maven-builder-support-3.x.jar
  constituent[38]: file:/usr/share/maven/lib/jsr250-api.jar
  constituent[39]: file:/usr/share/maven/lib/maven-plugin-api-3.x.jar
  constituent[40]: file:/usr/share/maven/lib/jcl-over-slf4j.jar
  constituent[41]: file:/usr/share/maven/lib/plexus-cipher.jar
  constituent[42]: file:/usr/share/maven/lib/sisu-plexus.jar
  ---------------------------------------------------
  Exception in thread &quot;main&quot; java.lang.NoSuchMethodError: 'void com.google.common.base.Preconditions.checkArgument(boolean, java.lang.String, java.lang.Object)'
      at com.google.inject.Key.ensureRetainedAtRuntime(Key.java:341)
      at com.google.inject.Key.strategyFor(Key.java:335)
      at com.google.inject.Key.get(Key.java:219)
      at org.eclipse.sisu.wire.ParameterKeys.&lt;clinit&gt;(ParameterKeys.java:28)
      at org.eclipse.sisu.wire.DependencyAnalyzer.&lt;init&gt;(DependencyAnalyzer.java:93)
      at org.eclipse.sisu.wire.ElementAnalyzer.&lt;init&gt;(ElementAnalyzer.java:104)
      at org.eclipse.sisu.wire.WireModule.configure(WireModule.java:74)
      at com.google.inject.spi.Elements$RecordingBinder.install(Elements.java:344)
      at com.google.inject.spi.Elements.getElements(Elements.java:103)
      at com.google.inject.internal.InjectorShell$Builder.build(InjectorShell.java:137)
      at com.google.inject.internal.InternalInjectorCreator.build(InternalInjectorCreator.java:103)
      at com.google.inject.Guice.createInjector(Guice.java:87)
      at com.google.inject.Guice.createInjector(Guice.java:69)
      at com.google.inject.Guice.createInjector(Guice.java:59)
      at org.codehaus.plexus.DefaultPlexusContainer.addPlexusInjector(DefaultPlexusContainer.java:481)
      at org.codehaus.plexus.DefaultPlexusContainer.&lt;init&gt;(DefaultPlexusContainer.java:206)
      at org.apache.maven.cli.MavenCli.container(MavenCli.java:636)
      at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:282)
      at org.apache.maven.cli.MavenCli.main(MavenCli.java:193)
      at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:78)
      at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.base/java.lang.reflect.Method.invoke(Method.java:567)
      at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:282)
      at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:225)
      at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:406)
      at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:347)
  </code></pre>
  <p>The keyword here is <code>NoSuchMethodError</code> about the <code>com.google.common.base.Preconditions.checkArgument(boolean, java.lang.String, java.lang.Object)</code> function, which seems to be missing.</p>
  <p>From <a href="https://stackoverflow.com/questions/67831548/java-lang-nosuchmethoderror-void-com-google-common-base-preconditions-checkarg">this question</a> asked and answered by @Menghe, I have tried to reinstall maven, but it does not have fixed the problem.</p>
  <h2>My Configuration</h2>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th>Software</th>
  <th>Version</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td>Ubuntu</td>
  <td>20.04.1</td>
  </tr>
  <tr>
  <td>Java</td>
  <td>16.0.2</td>
  </tr>
  <tr>
  <td>Maven</td>
  <td>3.6.3</td>
  </tr>
  </tbody>
  </table>
  </div>
  <p>It is possible to get an advice ?</p>
  <p>Thanks in advance for your help.</p>