I installed JDK 14 and started using it.
However projects that use Gradle 6.2.2 cannot work, and the following error appears each time I try to invoke a Gradle Task :
Could not initialize class org.codehaus.groovy.runtime.InvokerHelper
Other projects, for instance maven projects and plain java projects work OK with Java 14.
An easy way to reproduce this error is by creating a new folder and attempting to run the init
task.
For instance:
gradle init --type basic
FAILURE: Build failed with an exception.
What went wrong: Could not initialize class org.codehaus.groovy.runtime.InvokerHelper
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 878ms
The PC that runs this example uses windows 10. The java version is:
java --version
java 14 2020-03-17 Java(TM) SE Runtime Environment (build 14+36-1461)
Java HotSpot(TM) 64-Bit Server VM (build 14+36-1461, mixed mode, sharing)
Is there any solution to this problem so that I can make Gradle 6.2.2 work with Oracle JDK 14?