title: Getting NoClassDefFoundError: Could not initialize class org.codehaus.groovy.vmplugin.v7.Java7
body: <p>I am getting the following error when I start my Spring Boot application.</p>
  <pre><code>java.lang.NoClassDefFoundError: Could not initialize class org.codehaus.groovy.reflection.ReflectionCache
      at org.codehaus.groovy.runtime.dgmimpl.NumberNumberMetaMethod.&lt;clinit&gt;(NumberNumberMetaMethod.java:33) ~[groovy-2.5.8.jar:2.5.8]
      at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[na:na]
      at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) ~[na:na]
      at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[na:na]
      at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:500) ~[na:na]
      at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:481) ~[na:na]
      at org.codehaus.groovy.runtime.metaclass.MetaClassRegistryImpl.createMetaMethodFromClass(MetaClassRegistryImpl.java:258) ~[groovy-2.5.8.jar:2.5.8]
      at org.codehaus.groovy.runtime.metaclass.MetaClassRegistryImpl.&lt;init&gt;(MetaClassRegistryImpl.java:111) ~[groovy-2.5.8.jar:2.5.8]
      at org.codehaus.groovy.runtime.metaclass.MetaClassRegistryImpl.&lt;init&gt;(MetaClassRegistryImpl.java:86) ~[groovy-2.5.8.jar:2.5.8]
      at groovy.lang.GroovySystem.&lt;clinit&gt;(GroovySystem.java:36) ~[groovy-2.5.8.jar:2.5.8]
      at org.springframework.beans.factory.groovy.GroovyBeanDefinitionReader.&lt;init&gt;(GroovyBeanDefinitionReader.java:150) ~[spring-beans-5.2.2.RELEASE.jar:5.2.2.RELEASE]
      at org.springframework.boot.BeanDefinitionLoader.&lt;init&gt;(BeanDefinitionLoader.java:85) ~[spring-boot-2.2.2.RELEASE.jar:2.2.2.RELEASE]
      at org.springframework.boot.SpringApplication.createBeanDefinitionLoader(SpringApplication.java:738) ~[spring-boot-2.2.2.RELEASE.jar:2.2.2.RELEASE]
      at org.springframework.boot.SpringApplication.load(SpringApplication.java:681) ~[spring-boot-2.2.2.RELEASE.jar:2.2.2.RELEASE]
      at org.springframework.boot.SpringApplication.prepareContext(SpringApplication.java:392) ~[spring-boot-2.2.2.RELEASE.jar:2.2.2.RELEASE]
      at org.springframework.boot.SpringApplication.run(SpringApplication.java:314) ~[spring-boot-2.2.2.RELEASE.jar:2.2.2.RELEASE]
      at org.springframework.boot.SpringApplication.run(SpringApplication.java:1226) ~[spring-boot-2.2.2.RELEASE.jar:2.2.2.RELEASE]
      at org.springframework.boot.SpringApplication.run(SpringApplication.java:1215) ~[spring-boot-2.2.2.RELEASE.jar:2.2.2.RELEASE]
      at pizzainthecloud.pizzaplace.Application.main(Application.java:23) ~[main/:na]
  </code></pre>
  <p>After much searching, I found several instances of this including <a href="https://stackoverflow.com/questions/61289461/java-lang-noclassdeffounderror-could-not-initialize-class-org-codehaus-groovy-v">java.lang.NoClassDefFoundError: Could not initialize class org.codehaus.groovy.vmplugin.v7.Java7</a>, but most are older posts on older versions of gradle and groovy or they are related to android.</p>
  <p>Here is my version info:</p>
  <pre><code>$ gradle -version
  
  ------------------------------------------------------------
  Gradle 6.6.1
  ------------------------------------------------------------
  
  Build time:   2020-08-25 16:29:12 UTC
  Revision:     f2d1fb54a951d8b11d25748e4711bec8d128d7e3
  
  Kotlin:       1.3.72
  Groovy:       2.5.12
  Ant:          Apache Ant(TM) version 1.10.8 compiled on May 10 2020
  JVM:          14.0.2 (Oracle Corporation 14.0.2+12-46)
  OS:           Linux 5.4.0-42-generic amd64
  </code></pre>
  <p>I am not doing any groovy apart from my unit tests that are entirely groovy/spock and I'm using gradle for my build engine.</p>
  <p>Following directions I found, I went ahead and changed my <code>gradle-wrapper.properties</code> file to</p>
  <pre><code>distributionUrl=https\://services.gradle.org/distributions/gradle-6.6-bin.zip
  </code></pre>
  <p>it was 6.5-bin.</p>
  <p>This project was running fine on my old computer with Java 8. I moved it to my new workstation and am trying to move to <code>open JDK 14</code>, and that is when the new issue started.</p>
  <p>Wondering where to go from here.</p>