. Advertisement .
..3..
. Advertisement .
..4..
Hi everyone, I’m learning about java. While working, I try use below tools: STS 3.9.10 release, Open JDK 14 64 bit, Spring boot 2.2.5. As a result, I get the message:
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
What can I do about the “java.lang.NoClassDefFoundError: Could not initialize class org.codehaus.groovy.vmplugin.v7.Java7” issue? Is there a better approach?
The cause:
You are using Gradle as the build system and your JDK14 and the Gradle version is outdated. That is the reason why you have to face with this error now.
Solution:
This error will be solved if the gradle-wrapper.properties file is editted inside the gradle folder. ( Is not .gradle).
Let’s replace below line:
by
Then run it again and the error will disappear.
How do you run the application. This is likely because you are using Gradle as your build system, JDK14 and Gradle version 10248. Reference: https://github.com/gradle/gradle/issues/10248
Refer to
$PROJECT_ROOT/gradle/wrapper/gradle-wrapper.properties
if you use Gradle Wrapper$PROJECT_ROOT/gradle/wrapper/gradle-wrapper.properties
should be used if you use Gradle Wrapper.It can be an older version, so you should change it. Run
./gradlew clean build
again and try it again.