如果使用Gradle Wrapper,请参考 $ PROJECT_ROOT/gradle/wrapper/gradle-wrapper.properties .属性distributionUrl应该为: distributionUrl = https \://services.gradle.org/distributions/gradle-6.3-bin.zip 如果是较旧的版本,则进行更改,请运行 ./gradlew clean build ,然后重试.I am getting this exception java.lang.NoClassDefFoundError: Could not initialize class org.codehaus.groovy.vmplugin.v7.Java7 and java.lang.NoClassDefFoundError: Could not initialize class org.codehaus.groovy.reflection.ReflectionCache) when i run the spring boot applicationI am using below toolsSTS 3.9.10 releaseOpen JDK 14 64 bitSpring boot 2.2.5It worked fine with oracle jdk but its failing to run with openjdk. I am not using any groovy libs. This is maven based spring boot project. 解决方案 How do you run the application? It's probably because you use Gradle as the build system and JDK14 and the Gradle version is old.Reference: https://github.com/gradle/gradle/issues/10248If you use Gradle Wrapper then refer to $PROJECT_ROOT/gradle/wrapper/gradle-wrapper.properties. Property distributionUrl should be:distributionUrl=https\://services.gradle.org/distributions/gradle-6.3-bin.zipIf it's an older version then change it, run ./gradlew clean build and try again. 这篇关于java.lang.NoClassDefFoundError:无法初始化类org.codehaus.groovy.vmplugin.v7.Java7的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云! 07-29 17:03