title: Gradle error: Could not initialize class org.codehaus.groovy.runtime.InvokerHelper
body: <p>I need to see my dependencies in Gradle to fix a problem with multiple SLF4J bindings.<br>
  However, when I run 'gradle dependencies' I get the error:</p>
  
  <p><em>Could not initialize class org.codehaus.groovy.runtime.InvokerHelper</em></p>
  
  <p>In a similar question in stack-overflow <a href="https://stackoverflow.com/questions/35000729/android-studio-could-not-initialize-class-org-codehaus-groovy-runtime-invokerhel">Android Studio Could not initialize class org.codehaus.groovy.runtime.InvokerHelper</a><br>
  it was recommended to  </p>
  
  <ol>
  <li>install java jdk-14  </li>
  <li>upgrade to gradle version 6.3</li>
  </ol>
  
  <p>I changed the jdk to 14 in IntelliJ in 2 places: </p>
  
  <ol>
  <li>File -> Project Structure -> Project -> Project SDK  </li>
  <li>Preferences -> Gradle -> Gradle JVM</li>
  </ol>
  
  <p>I attempted to update gradle from the command line with:
  'gradle wrapper --gradle-version 6.3'
  and got the same error:  </p>
  
  <p><em>Could not initialize class org.codehaus.groovy.runtime.InvokerHelper</em></p>
  
  <p>I then changed the field 'distributionUrl' in the file 'gradle-wrapper.properties' to 'gradle-6.3', as instructed here <a href="https://github.com/gradle/gradle/issues/10248" rel="noreferrer">https://github.com/gradle/gradle/issues/10248</a>.</p>
  
  <p>I tried various combinations of jdk and gradle versions but nothing seems to work.</p>