Could not initialize class org.codehaus.groovy.reflection.ReflectionCache
Exception java.lang.NoClassDefFoundError: Could not initialize class org.codehaus.groovy.vmplugin.v7.Java7
I:\Selenium_IntelliJ\VideoGameDB-master>gradlew clean build --refresh-dependencies --stacktrace
FAILURE: Build failed with an exception.
* What went wrong:
Could not initialize class org.codehaus.groovy.runtime.InvokerHelper
> Exception java.lang.NoClassDefFoundError: Could not initialize class org.codehaus.groovy.reflection.ReflectionCache [in thread "Daemon worker"]
* Try:
Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Exception is:
java.lang.NoClassDefFoundError: Could not initialize class org.codehaus.groovy.runtime.InvokerHelper
at org.gradle.internal.extensibility.DefaultExtraPropertiesExtension.<init>(DefaultExtraPropertiesExtension.java:29)
Never use gradle, but always gradlew.
Best just uninstall Gradle, then you don’t accidentally use the wrong one.
What about gradlew --version?
And please never anywhere share screenshots of text if you only want to share the text and not something additional like colors or IDE annotations. Text in images is hard to read, especially on mobile, very hard to copy, and nearly impossible to search for.
I:\Selenium_IntelliJ\VideoGameDB-master>gradlew build --scan
FAILURE: Build failed with an exception.
* What went wrong:
Could not initialize class org.codehaus.groovy.runtime.InvokerHelper
> Exception java.lang.NoClassDefFoundError: Could not initialize class org.codehaus.groovy.reflection.ReflectionCache [in thread "Daemon worker"]
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 489ms
--------------------------------------------------------------------------------------
'gradlew' is not recognized as an internal or external command,
operable program or batch file.
I downloaded the ZIP and placed in env path variables in Windows 11 from the following website :-
I am new with gradle, what is gradle wrapper? Please me with this. I am trying to run DB application with API endpoints. Following is the documentation of that :
VideoGameDB
Video Game Database application with API endpoints that support JSON and XML
This application was developed to support my Udemy courses:
-------------------------------------------------------------------------
gradle -version
Welcome to Gradle 8.13!
Here are the highlights of this release:
- Daemon JVM auto-provisioning
- Enhancements for Scala plugin and JUnit testing
- Improvements for build authors and plugin developers
For more details see https://docs.gradle.org/8.13/release-notes.html
------------------------------------------------------------
Gradle 8.13
------------------------------------------------------------
Build time: 2025-02-25 09:22:14 UTC
Revision: 073314332697ba45c16c0a0ce1891fa6794179ff
Kotlin: 2.0.21
Groovy: 3.0.22
Ant: Apache Ant(TM) version 1.10.15 compiled on August 25 2024
Launcher JVM: 17.0.8 (Oracle Corporation 17.0.8+9-LTS-211)
Daemon JVM: C:\Program Files\Java\jdk-17 (no JDK specified, using current Java home)
OS: Windows 11 10.0 amd64