Error during installation of Apache OFBiz

Gradle 5.0-rc-5 came with Apache OFBiz
I am getting this error during “gradlew cleanAll loadAll”

12:08:03.246 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Build operation 'Load build' completed
12:08:03.246 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]
12:08:03.246 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] FAILURE: Build failed with an exception.
12:08:03.246 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]
12:08:03.246 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] * What went wrong:
12:08:03.246 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] Could not create an instance of type org.gradle.initialization.DefaultSettings_Decorated.
12:08:03.247 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] > Could not initialize class org.codehaus.groovy.runtime.InvokerHelper
12:08:03.247 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]
12:08:03.247 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] * Try:
12:08:03.247 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] Run with --stacktrace option to get the stack trace.  Run with --scan to get full insights.
12:08:03.247 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]
12:08:03.247 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] * Get more help at

Any help would be much appreciated.
Thank you

You provided not enough information for any evaluation, but I highly suspect you are using a too new and thus incompatible Java version. See here: Compatibility Matrix

Thank you.
I am using JDK 19 and Gradle 5.0 only uses JDK 11.