Gradle: JDK 14 support

Created on 9 Aug 2019  ·  115Comments  ·  Source: gradle/gradle

Expected Behavior

gradle should run with the latest JDK 14 ea.

Current Behavior

gradle -version works, but running any gradle task, including gradle tasks will throw an exception right away.

Context

Trying to do a build using the latest version of gradle.

Steps to Reproduce

  1. Download the latest JDK 14 EA build from http://jdk.java.net/14/
  2. Set your PATH and JAVA_HOME variables to point to jdk-14
  3. Run gradle -version -- that correctly prints:
------------------------------------------------------------
Gradle 5.5.1
------------------------------------------------------------

Build time:   2019-07-10 20:38:12 UTC
Revision:     3245f748c7061472da4dc184991919810f7935a5

Kotlin:       1.3.31
Groovy:       2.5.4
Ant:          Apache Ant(TM) version 1.9.14 compiled on March 12 2019
JVM:          14-ea (Oracle Corporation 14-ea+9-288)
OS:           Linux 4.4.0-157-generic amd64
  1. Now run gradle tasks (it doesn't matter what is in your build.gradle file or whether you even have one) -- it will fail with the following exception:
java.lang.NoClassDefFoundError: Could not initialize class org.codehaus.groovy.vmplugin.v7.Java7
        at org.codehaus.groovy.vmplugin.VMPluginFactory.<clinit>(VMPluginFactory.java:43)
        at org.codehaus.groovy.reflection.GroovyClassValueFactory.<clinit>(GroovyClassValueFactory.java:35)
        at org.codehaus.groovy.reflection.ClassInfo.<clinit>(ClassInfo.java:109)
        at org.codehaus.groovy.reflection.ReflectionCache.getCachedClass(ReflectionCache.java:95)
        at org.codehaus.groovy.reflection.ReflectionCache.<clinit>(ReflectionCache.java:39)
        at org.codehaus.groovy.runtime.metaclass.MetaClassRegistryImpl.registerMethods(MetaClassRegistryImpl.java:209)
        at org.codehaus.groovy.runtime.metaclass.MetaClassRegistryImpl.<init>(MetaClassRegistryImpl.java:107)
        at org.codehaus.groovy.runtime.metaclass.MetaClassRegistryImpl.<init>(MetaClassRegistryImpl.java:85)
        at groovy.lang.GroovySystem.<clinit>(GroovySystem.java:36)
        at org.codehaus.groovy.runtime.InvokerHelper.<clinit>(InvokerHelper.java:86)
        at groovy.lang.GroovyObjectSupport.getDefaultMetaClass(GroovyObjectSupport.java:59)
        at groovy.lang.GroovyObjectSupport.<init>(GroovyObjectSupport.java:32)
        at org.gradle.internal.extensibility.DefaultExtraPropertiesExtension.<init>(DefaultExtraPropertiesExtension.java:29)
        at org.gradle.internal.extensibility.DefaultConvention.<init>(DefaultConvention.java:48)
        at org.gradle.api.internal.plugins.DefaultConvention.<init>(DefaultConvention.java:28)
        at org.gradle.internal.extensibility.ExtensibleDynamicObject.<init>(ExtensibleDynamicObject.java:60)
        at org.gradle.internal.instantiation.MixInExtensibleDynamicObject.<init>(MixInExtensibleDynamicObject.java:34)
        at org.gradle.initialization.DefaultSettings_Decorated.getAsDynamicObject(Unknown Source)
        at org.gradle.initialization.SettingsFactory.createSettings(SettingsFactory.java:58)
        at org.gradle.initialization.ScriptEvaluatingSettingsProcessor.process(ScriptEvaluatingSettingsProcessor.java:60)
        at org.gradle.initialization.PropertiesLoadingSettingsProcessor.process(PropertiesLoadingSettingsProcessor.java:37)
        at org.gradle.initialization.SettingsEvaluatedCallbackFiringSettingsProcessor.process(SettingsEvaluatedCallbackFiringSettingsProcessor.java:34)
        at org.gradle.initialization.RootBuildCacheControllerSettingsProcessor.process(RootBuildCacheControllerSettingsProcessor.java:36)
        at org.gradle.initialization.BuildOperationSettingsProcessor$2.call(BuildOperationSettingsProcessor.java:50)
        at org.gradle.initialization.BuildOperationSettingsProcessor$2.call(BuildOperationSettingsProcessor.java:47)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor$CallableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:416)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor$CallableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:406)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor$1.execute(DefaultBuildOperationExecutor.java:165)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:250)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:158)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:102)
        at org.gradle.internal.operations.DelegatingBuildOperationExecutor.call(DelegatingBuildOperationExecutor.java:36)
        at org.gradle.initialization.BuildOperationSettingsProcessor.process(BuildOperationSettingsProcessor.java:47)
        at org.gradle.initialization.DefaultSettingsLoader.findSettingsAndLoadIfAppropriate(DefaultSettingsLoader.java:104)
        at org.gradle.initialization.DefaultSettingsLoader.findAndLoadSettings(DefaultSettingsLoader.java:45)
        at org.gradle.initialization.SettingsAttachingSettingsLoader.findAndLoadSettings(SettingsAttachingSettingsLoader.java:35)
        at org.gradle.internal.composite.ChildBuildRegisteringSettingsLoader.findAndLoadSettings(ChildBuildRegisteringSettingsLoader.java:47)
        at org.gradle.initialization.DefaultSettingsPreparer.prepareSettings(DefaultSettingsPreparer.java:36)
        at org.gradle.initialization.NotifyingSettingsPreparer$LoadBuild.doLoadBuild(NotifyingSettingsPreparer.java:59)
        at org.gradle.initialization.NotifyingSettingsPreparer$LoadBuild.run(NotifyingSettingsPreparer.java:54)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:402)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:394)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor$1.execute(DefaultBuildOperationExecutor.java:165)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:250)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:158)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:92)
        at org.gradle.internal.operations.DelegatingBuildOperationExecutor.run(DelegatingBuildOperationExecutor.java:31)
        at org.gradle.initialization.NotifyingSettingsPreparer.prepareSettings(NotifyingSettingsPreparer.java:42)
        at org.gradle.initialization.DefaultGradleLauncher.prepareSettings(DefaultGradleLauncher.java:189)
        at org.gradle.initialization.DefaultGradleLauncher.doClassicBuildStages(DefaultGradleLauncher.java:133)
        at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:125)
        at org.gradle.initialization.DefaultGradleLauncher.executeTasks(DefaultGradleLauncher.java:105)
        at org.gradle.internal.invocation.GradleBuildController$1.execute(GradleBuildController.java:58)
        at org.gradle.internal.invocation.GradleBuildController$1.execute(GradleBuildController.java:55)
        at org.gradle.internal.invocation.GradleBuildController$3.create(GradleBuildController.java:82)
        at org.gradle.internal.invocation.GradleBuildController$3.create(GradleBuildController.java:75)
        at org.gradle.internal.work.DefaultWorkerLeaseService.withLocks(DefaultWorkerLeaseService.java:183)
        at org.gradle.internal.work.StopShieldingWorkerLeaseService.withLocks(StopShieldingWorkerLeaseService.java:40)
        at org.gradle.internal.invocation.GradleBuildController.doBuild(GradleBuildController.java:75)
        at org.gradle.internal.invocation.GradleBuildController.run(GradleBuildController.java:55)
        at org.gradle.initialization.buildsrc.BuildSrcUpdateFactory.build(BuildSrcUpdateFactory.java:55)
        at org.gradle.initialization.buildsrc.BuildSrcUpdateFactory.create(BuildSrcUpdateFactory.java:45)
        at org.gradle.initialization.buildsrc.BuildSourceBuilder$3.transform(BuildSourceBuilder.java:124)
        at org.gradle.initialization.buildsrc.BuildSourceBuilder$3.transform(BuildSourceBuilder.java:118)
        at org.gradle.composite.internal.DefaultNestedBuild.run(DefaultNestedBuild.java:73)
        at org.gradle.initialization.buildsrc.BuildSourceBuilder.buildBuildSrc(BuildSourceBuilder.java:118)
        at org.gradle.initialization.buildsrc.BuildSourceBuilder.access$000(BuildSourceBuilder.java:45)
        at org.gradle.initialization.buildsrc.BuildSourceBuilder$2.call(BuildSourceBuilder.java:96)
        at org.gradle.initialization.buildsrc.BuildSourceBuilder$2.call(BuildSourceBuilder.java:93)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor$CallableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:416)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor$CallableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:406)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor$1.execute(DefaultBuildOperationExecutor.java:165)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:250)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:158)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:102)
        at org.gradle.internal.operations.DelegatingBuildOperationExecutor.call(DelegatingBuildOperationExecutor.java:36)
        at org.gradle.initialization.buildsrc.BuildSourceBuilder.createBuildSourceClasspath(BuildSourceBuilder.java:93)
        at org.gradle.initialization.buildsrc.BuildSourceBuilder.buildAndCreateClassLoader(BuildSourceBuilder.java:73)
        at org.gradle.initialization.DefaultSettingsLoader.findSettingsAndLoadIfAppropriate(DefaultSettingsLoader.java:102)
        at org.gradle.initialization.DefaultSettingsLoader.findAndLoadSettings(DefaultSettingsLoader.java:45)
        at org.gradle.initialization.SettingsAttachingSettingsLoader.findAndLoadSettings(SettingsAttachingSettingsLoader.java:35)
        at org.gradle.internal.composite.CommandLineIncludedBuildSettingsLoader.findAndLoadSettings(CommandLineIncludedBuildSettingsLoader.java:34)
        at org.gradle.internal.composite.ChildBuildRegisteringSettingsLoader.findAndLoadSettings(ChildBuildRegisteringSettingsLoader.java:47)
        at org.gradle.internal.composite.CompositeBuildSettingsLoader.findAndLoadSettings(CompositeBuildSettingsLoader.java:35)
        at org.gradle.initialization.DefaultSettingsPreparer.prepareSettings(DefaultSettingsPreparer.java:36)
        at org.gradle.initialization.NotifyingSettingsPreparer$LoadBuild.doLoadBuild(NotifyingSettingsPreparer.java:59)
        at org.gradle.initialization.NotifyingSettingsPreparer$LoadBuild.run(NotifyingSettingsPreparer.java:54)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:402)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:394)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor$1.execute(DefaultBuildOperationExecutor.java:165)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:250)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:158)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:92)
        at org.gradle.internal.operations.DelegatingBuildOperationExecutor.run(DelegatingBuildOperationExecutor.java:31)
        at org.gradle.initialization.NotifyingSettingsPreparer.prepareSettings(NotifyingSettingsPreparer.java:42)
        at org.gradle.initialization.DefaultGradleLauncher.prepareSettings(DefaultGradleLauncher.java:189)
        at org.gradle.initialization.DefaultGradleLauncher.doClassicBuildStages(DefaultGradleLauncher.java:133)
        at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:125)
        at org.gradle.initialization.DefaultGradleLauncher.executeTasks(DefaultGradleLauncher.java:105)
        at org.gradle.internal.invocation.GradleBuildController$1.execute(GradleBuildController.java:58)
        at org.gradle.internal.invocation.GradleBuildController$1.execute(GradleBuildController.java:55)
        at org.gradle.internal.invocation.GradleBuildController$3.create(GradleBuildController.java:82)
        at org.gradle.internal.invocation.GradleBuildController$3.create(GradleBuildController.java:75)
        at org.gradle.internal.work.DefaultWorkerLeaseService.withLocks(DefaultWorkerLeaseService.java:183)
        at org.gradle.internal.work.StopShieldingWorkerLeaseService.withLocks(StopShieldingWorkerLeaseService.java:40)
        at org.gradle.internal.invocation.GradleBuildController.doBuild(GradleBuildController.java:75)
        at org.gradle.internal.invocation.GradleBuildController.run(GradleBuildController.java:55)
        at org.gradle.tooling.internal.provider.ExecuteBuildActionRunner.run(ExecuteBuildActionRunner.java:31)
        at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35)
        at org.gradle.launcher.exec.BuildOutcomeReportingBuildActionRunner.run(BuildOutcomeReportingBuildActionRunner.java:58)
        at org.gradle.tooling.internal.provider.ValidatingBuildActionRunner.run(ValidatingBuildActionRunner.java:32)
        at org.gradle.launcher.exec.BuildCompletionNotifyingBuildActionRunner.run(BuildCompletionNotifyingBuildActionRunner.java:39)
        at org.gradle.launcher.exec.RunAsBuildOperationBuildActionRunner$3.call(RunAsBuildOperationBuildActionRunner.java:51)
        at org.gradle.launcher.exec.RunAsBuildOperationBuildActionRunner$3.call(RunAsBuildOperationBuildActionRunner.java:45)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor$CallableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:416)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor$CallableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:406)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor$1.execute(DefaultBuildOperationExecutor.java:165)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:250)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:158)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:102)
        at org.gradle.internal.operations.DelegatingBuildOperationExecutor.call(DelegatingBuildOperationExecutor.java:36)
        at org.gradle.launcher.exec.RunAsBuildOperationBuildActionRunner.run(RunAsBuildOperationBuildActionRunner.java:45)
        at org.gradle.launcher.exec.InProcessBuildActionExecuter$1.transform(InProcessBuildActionExecuter.java:49)
        at org.gradle.launcher.exec.InProcessBuildActionExecuter$1.transform(InProcessBuildActionExecuter.java:46)
        at org.gradle.composite.internal.DefaultRootBuildState.run(DefaultRootBuildState.java:78)
        at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:46)
        at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:31)
        at org.gradle.launcher.exec.BuildTreeScopeBuildActionExecuter.execute(BuildTreeScopeBuildActionExecuter.java:42)
        at org.gradle.launcher.exec.BuildTreeScopeBuildActionExecuter.execute(BuildTreeScopeBuildActionExecuter.java:28)
        at org.gradle.tooling.internal.provider.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:78)
        at org.gradle.tooling.internal.provider.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:52)
        at org.gradle.tooling.internal.provider.SubscribableBuildActionExecuter.execute(SubscribableBuildActionExecuter.java:59)
        at org.gradle.tooling.internal.provider.SubscribableBuildActionExecuter.execute(SubscribableBuildActionExecuter.java:36)
        at org.gradle.tooling.internal.provider.SessionScopeBuildActionExecuter.execute(SessionScopeBuildActionExecuter.java:68)
        at org.gradle.tooling.internal.provider.SessionScopeBuildActionExecuter.execute(SessionScopeBuildActionExecuter.java:38)
        at org.gradle.tooling.internal.provider.GradleThreadBuildActionExecuter.execute(GradleThreadBuildActionExecuter.java:37)
        at org.gradle.tooling.internal.provider.GradleThreadBuildActionExecuter.execute(GradleThreadBuildActionExecuter.java:26)
        at org.gradle.tooling.internal.provider.ParallelismConfigurationBuildActionExecuter.execute(ParallelismConfigurationBuildActionExecuter.java:43)
        at org.gradle.tooling.internal.provider.ParallelismConfigurationBuildActionExecuter.execute(ParallelismConfigurationBuildActionExecuter.java:29)
        at org.gradle.tooling.internal.provider.StartParamsValidatingActionExecuter.execute(StartParamsValidatingActionExecuter.java:60)
        at org.gradle.tooling.internal.provider.StartParamsValidatingActionExecuter.execute(StartParamsValidatingActionExecuter.java:32)
        at org.gradle.tooling.internal.provider.SessionFailureReportingActionExecuter.execute(SessionFailureReportingActionExecuter.java:55)
        at org.gradle.tooling.internal.provider.SessionFailureReportingActionExecuter.execute(SessionFailureReportingActionExecuter.java:41)
        at org.gradle.tooling.internal.provider.SetupLoggingActionExecuter.execute(SetupLoggingActionExecuter.java:48)
        at org.gradle.tooling.internal.provider.SetupLoggingActionExecuter.execute(SetupLoggingActionExecuter.java:32)
        at org.gradle.launcher.cli.RunBuildAction.run(RunBuildAction.java:55)
        at org.gradle.internal.Actions$RunnableActionAdapter.execute(Actions.java:208)
        at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:394)
        at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:367)
        at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:37)
        at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:23)
        at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:360)
        at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:292)
        at org.gradle.launcher.Main.doAction(Main.java:36)
        at org.gradle.launcher.bootstrap.EntryPoint.run(EntryPoint.java:45)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:565)
        at org.gradle.launcher.bootstrap.ProcessBootstrap.runNoExit(ProcessBootstrap.java:60)
        at org.gradle.launcher.bootstrap.ProcessBootstrap.run(ProcessBootstrap.java:37)
        at org.gradle.launcher.GradleMain.main(GradleMain.java:23)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:565)
        at org.gradle.wrapper.BootstrapMainStarter.start(BootstrapMainStarter.java:31)
        at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:108)
        at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:61)

FAILURE: Build failed with an exception.

* What went wrong:
Could not initialize class org.codehaus.groovy.reflection.ReflectionCache
@core bug contributor

Most helpful comment

As a React Native developer, I upgraded the gradle to 6.3 as suggested above and it fixed my problem.
Java version: java 14 2020-03-17
React Native version: 0.61.5

Upgrade gradle to 6.3:
In gradle-wrapper.properties: change the line to:
distributionUrl=https\://services.gradle.org/distributions/gradle-6.3-all.zip

All 115 comments

This is broken in JDK14 b8.
This is a bug in groovy-git/src/main/org/codehaus/groovy/vmplugin/v7/Java7.java
It seems to be hacking one of Lookup's constructors. The constructor is private and does not exist in JDK 14 as we've refactored this area as part of the work to fix the issues teleporting with Lookup objects.
There is a try/catch block but it is catching a SecurityException. This type of error starting in JDK9 throws a new JDK9 runtime exception. To write portable code, you can't catch the exact exception but instead use catch (RuntimeException).

I note that the gradle doesn't work (at least not for Java projects) on JDK 13 either, due to #8681. That bug is currently targeted to gradle 6.0.

Yes, I already hacked a copy of gradle that replaces the asm class with a copy that does not check the class version number so I can continue to work on gradle 5.x.

We need to get out of the mode where we need a new version every 6 months.

  1. Projects like Spring have simply removed the check from their repackaged ClassReader.

2 Eclipselink uses its own superclass of ClassReader that calls the protected API in ClassReader with a flag to bypass the check.

  1. The latest HK2 removed its repackaged ASM so you can bring your own smarter ASM.

Pick an option as long as we get away from the 6-month cycle.

My preferred solution would be to have ASM visible in the JDK. There is a repackaged version of ASM in the JDK but it's not public.

Same thing happens with the recently released Groovy 2.5.8:

$ groovy-2.5.8/bin/groovy hello.groovy 
java.lang.NoClassDefFoundError: Could not initialize class org.codehaus.groovy.vmplugin.v7.Java7
    at org.codehaus.groovy.vmplugin.VMPluginFactory.<clinit>(VMPluginFactory.java:43)
    at org.codehaus.groovy.reflection.GroovyClassValueFactory.<clinit>(GroovyClassValueFactory.java:35)
:

With JDK 13, 12, 11, ... it seems to load org.codehaus.groovy.vmplugin.v9.Java9 but then loads org.codehaus.groovy.vmplugin.v7.Java7 where it tries to hack into one of Lookup's private constructors. That causes a warning at run-time. The constructor doesn't exist in JDK 14 so the hack fails.

Any update on this? I just tried with the latest Java 14 early access build (build 21) and with the latest Gradle RC (Gradle 6.0 RC2) and it is still failing with the same error.

Gradle is a great build tool, but if it doesn't keep pace with the Java version updates it is not even an option to use.

Gradle 6.0.1 continues to fail on this.

Having same issue when trying to compile Ghidra. Would appreciate any workaround for this issue...

Gradle 6.1-milestone-3 fails with a CNFE regarding org.codehaus.groovy.runtime.InvokerHelper.

getting this exact issue for
Gradle 6.0.1
Build time: 2019-11-18 20:25:01 UTC
Revision: fad121066a68c4701acd362daf4287a7c309a0f5
Kotlin: 1.3.50
Groovy: 2.5.8
Ant: Apache Ant(TM) version 1.10.7 compiled on September 1 2019
JVM: 14-ea (Oracle Corporation 14-ea+27-1339)
OS: Linux 5.0.0-37-generic amd64

Gradle 6.1-milestone-3 fails with a CNFE regarding org.codehaus.groovy.runtime.InvokerHelper.

The same Could not initialize class org.codehaus.groovy.runtime.InvokerHelper for Gradle 6.1-rc-1

I think that GROOVY-9211 can be backported to 2.5.x easily and then gradle can be updated but there is no activity in the bug, altough it's mentioned that it should be backported

The 1st release candidate for OpenJDK 14 will be available on Feb. 6: https://openjdk.java.net/projects/jdk/14/#Schedule

Is there any chance this issue was fixed in Groovy 2.5.9, which has already been released but isn't yet used by Gradle (as of Gradle 6.1.1)?

I don't think so @rgoldberg - when looking at the 2.5.9 code there seems to be the backport of https://github.com/apache/groovy/commit/f40f76af134b6d5fd2d466d410ac48ad907e3b15 still missing. Unfortunately.

Seems like GROOVY-9211 won't be backported to 2.5.x. So it seems that Gradle will need to upgrade to Groovy 3.x once it's out in order to support JDK 14.

Groovy 3.0.0 is finally available

There is also Spock 2.0-M2 available which provides support for Groovy 3 (Spock 1.3 cannot be used with Groovy 3).

Is there an ETA for this? It would be nice if there were a version of Gradle that works on the day that JDK 14 goes GA, 2020/03/17.

For the record, Apache Calcite is blocked on this but won't be urgent for a month or so.

Can anyone test gradle with a snapshot of Groovy. If it works we can release 2.5.10.
Snapshots:
https://oss.jfrog.org/artifactory/oss-snapshot-local/org/codehaus/groovy/groovy/2.5.10-SNAPSHOT/

How would I do that?

@paulk-asert We're (@rieske) taking a look. If things look good this week, how soon would you be able to release 2.5.10?

@xzel23 we'll have to build a nightly version of Gradle with this Groovy snapshot.

@big-guy We are checking with a few projects but failing further feedback we are a few days from when we could kick off a release. Apache releases have a 3-day voting period. So 1 week from now at the earliest before releases would be in Maven central. I'd expect we'd release no later than 3 weeks from now at the latest pending major feedback.

@rieske I downloaded the nightly, and I can confirm that the above mentioned exception does not occur.

However, I get an error for the following line in my build script:

    userOrg = findProperty('BINTRAY_USER_ORG') ?: 'NONE'

Output from build:

axel@xiaolong-2 utility % ~/bin/gradle-6.3-branch-vv_test_jdk14-20200228131914+0000/bin/gradle clean

FAILURE: Build failed with an exception.

* Where:
Build file '/Users/axel/Development/lib/utility/build.gradle' line: 90

* What went wrong:
A problem occurred evaluating root project 'utility'.
> Could not find method findProperty() for arguments [BINTRAY_USER_ORG] on extension 'bintray' of type com.jfrog.bintray.gradle.BintrayExtension.

* 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 538ms

I don't know if that's caused by the new Groovy version or due to a change in Gradle itself.

PS: the build completes without error if I replace that line with

    userOrg = 'NONE'

Thanks @xzel23! This indeed looks to be related to the Groovy version update.
I just tried locally against a latest build from master versus the one with just the groovy update and got the same error.

I will have to replicate this in a test and investigate a bit more.

I did a build and test of JavaFX using JDK 14 and the above gradle 6.3 snapshot, and it looks good so far.

@rieske even if it isn't stable I can build my project(s) anyway. So thank you very much!

@xzel23 Could you give this version a try 6.3-branch-sg_merges_63_jdk_14-20200228234606+0000? I think this will fix the missing method exception.

@paulk-asert I think we're good with 2.5.10. :shipit:

@big-guy that one works.

Is there already a version with jdk 14 support available via (gradle) download url?
https://downloads.gradle.org/distributions/gradle-${GradleVersion}-bin.zip

Because our CI don't work without it.

We still get
java.lang.NoClassDefFoundError: Could not initialize class org.codehaus.groovy.vmplugin.v7.Java7
at gradle 6.2.1 (obviously)

@Jan5366x Unless you are restricted to downloads.gradle.org, you can use slightly different URL from the other server:
https://services.gradle.org/distributions-snapshots/gradle-6.3-branch-sg_merges_63_jdk_14-20200228234606+0000-bin.zip

@szpak This will work for me! Thank you very much for the fast response.

@Jan5366x Unless something prevents us from doing it, the plan is to have JDK14 support in 6.3 (due in a couple of weeks).

@paulk-asert Just to keep you in the loop. We'll be branching for Gradle 6.3 this week and we'll wait for a Groovy 2.5.10 release. If it looks like the Groovy release isn't coming by the end of next week, please let us know!

Groovy 2.5.10 is ready for voting but the voting post needs some information from the Apache Issue tracker which is down. Once it is up, I will kick off voting. Voting normally lasts for 72 hours. If the server isn't down too long I would expect voting to finish late Friday Brisbane time - early morning Friday US time. Of course, voting may not pass if issues are found.

Groovy 2.5.10 is released and seems to have sync'd up on most of the repos.
Please note there was a small regression that slipped through our testing that affects compilation of switch statements in one particular scenario:
http://groovy-lang.org/releasenotes/groovy-2.5.html#Groovy2.5releasenotes-Addendum2510
I'll let you decide whether that impacts Gradle unduly. It is already fixed in 2.5.11 snapshots and doesn't affect Groovy 3 versions.

Thank you!

Snapshot build is working fine for me FWIW

https://github.com/square/okhttp/pull/5838

A full build / test of JavaFX using gradle 6.3-rc1 with JDK 14 passed!

Is there a planned release date for 6.3?

@kevinrushforth It's tentatively planned for March 18th but that depends on the feedback for the first RC but it shouldn't be more than a few weeks from now.

I'm still seeing this issue running with 6.3-rc-1. See build failure for my tree here.
Error:

EchoTest STANDARD_ERROR

    java.lang.NoClassDefFoundError: Could not initialize class org.codehaus.groovy.vmplugin.v7.Java7

        at org.codehaus.groovy.vmplugin.VMPluginFactory.<clinit>(VMPluginFactory.java:43)

        at org.codehaus.groovy.reflection.GroovyClassValueFactory.<clinit>(GroovyClassValueFactory.java:35)

        at org.codehaus.groovy.reflection.ClassInfo.<clinit>(ClassInfo.java:107)

        at org.codehaus.groovy.reflection.ReflectionCache.getCachedClass(ReflectionCache.java:95)

        at org.codehaus.groovy.reflection.ReflectionCache.<clinit>(ReflectionCache.java:39)

        at org.codehaus.groovy.runtime.metaclass.MetaClassRegistryImpl.registerMethods(MetaClassRegistryImpl.java:210)

        at org.codehaus.groovy.runtime.metaclass.MetaClassRegistryImpl.<init>(MetaClassRegistryImpl.java:108)

        at org.codehaus.groovy.runtime.metaclass.MetaClassRegistryImpl.<init>(MetaClassRegistryImpl.java:86)

        at groovy.lang.GroovySystem.<clinit>(GroovySystem.java:36)

        at org.codehaus.groovy.runtime.InvokerHelper.<clinit>(InvokerHelper.java:86)

        at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.createMap(ScriptBytecodeAdapter.java:635)

        at io.restassured.internal.ResponseParserRegistrar.<init>(ResponseParserRegistrar.groovy)

        at io.restassured.RestAssured.<clinit>(RestAssured.java:347)

        at org.jpos.rest.APITestSupport.setUp(APITestSupport.java:52)

        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

        at java.base/java.lang.reflect.Method.invoke(Method.java:564)

        at org.junit.platform.commons.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:686)

        at org.junit.jupiter.engine.execution.MethodInvocation.proceed(MethodInvocation.java:60)

        at org.junit.jupiter.engine.execution.InvocationInterceptorChain$ValidatingInvocation.proceed(InvocationInterceptorChain.java:131)

        at org.junit.jupiter.engine.extension.TimeoutExtension.intercept(TimeoutExtension.java:149)

        at org.junit.jupiter.engine.extension.TimeoutExtension.interceptLifecycleMethod(TimeoutExtension.java:126)

        at org.junit.jupiter.engine.extension.TimeoutExtension.interceptBeforeAllMethod(TimeoutExtension.java:68)

        at org.junit.jupiter.engine.execution.ExecutableInvoker$ReflectiveInterceptorCall.lambda$ofVoidMethod$0(ExecutableInvoker.java:115)

        at org.junit.jupiter.engine.execution.ExecutableInvoker.lambda$invoke$0(ExecutableInvoker.java:105)

        at org.junit.jupiter.engine.execution.InvocationInterceptorChain$InterceptedInvocation.proceed(InvocationInterceptorChain.java:106)

        at org.junit.jupiter.engine.execution.InvocationInterceptorChain.proceed(InvocationInterceptorChain.java:64)

        at org.junit.jupiter.engine.execution.InvocationInterceptorChain.chainAndInvoke(InvocationInterceptorChain.java:45)

        at org.junit.jupiter.engine.execution.InvocationInterceptorChain.invoke(InvocationInterceptorChain.java:37)

        at org.junit.jupiter.engine.execution.ExecutableInvoker.invoke(ExecutableInvoker.java:104)

        at org.junit.jupiter.engine.execution.ExecutableInvoker.invoke(ExecutableInvoker.java:98)

        at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.lambda$invokeBeforeAllMethods$8(ClassBasedTestDescriptor.java:375)

        at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)

        at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.invokeBeforeAllMethods(ClassBasedTestDescriptor.java:373)

        at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.before(ClassBasedTestDescriptor.java:193)

        at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.before(ClassBasedTestDescriptor.java:78)

        at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$5(NodeTestTask.java:132)

        at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)

        at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$7(NodeTestTask.java:125)

        at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:135)

        at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:123)

        at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)

        at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:122)

        at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:80)

        at java.base/java.util.ArrayList.forEach(ArrayList.java:1510)

        at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:38)

        at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$5(NodeTestTask.java:139)

        at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)

        at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$7(NodeTestTask.java:125)

        at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:135)

        at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:123)

        at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)

        at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:122)

        at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:80)

        at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.submit(SameThreadHierarchicalTestExecutorService.java:32)

        at org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor.execute(HierarchicalTestExecutor.java:57)

        at org.junit.platform.engine.support.hierarchical.HierarchicalTestEngine.execute(HierarchicalTestEngine.java:51)

        at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:220)

        at org.junit.platform.launcher.core.DefaultLauncher.lambda$execute$6(DefaultLauncher.java:188)

        at org.junit.platform.launcher.core.DefaultLauncher.withInterceptedStreams(DefaultLauncher.java:202)

        at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:181)

        at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:128)

        at org.gradle.api.internal.tasks.testing.junitplatform.JUnitPlatformTestClassProcessor$CollectAllTestClassesExecutor.processAllTestClasses(JUnitPlatformTestClassProcessor.java:99)

        at org.gradle.api.internal.tasks.testing.junitplatform.JUnitPlatformTestClassProcessor$CollectAllTestClassesExecutor.access$000(JUnitPlatformTestClassProcessor.java:79)

        at org.gradle.api.internal.tasks.testing.junitplatform.JUnitPlatformTestClassProcessor.stop(JUnitPlatformTestClassProcessor.java:75)

        at org.gradle.api.internal.tasks.testing.SuiteTestClassProcessor.stop(SuiteTestClassProcessor.java:61)

        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

        at java.base/java.lang.reflect.Method.invoke(Method.java:564)

        at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:36)

        at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)

        at org.gradle.internal.dispatch.ContextClassLoaderDispatch.dispatch(ContextClassLoaderDispatch.java:33)

        at org.gradle.internal.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.java:94)

        at com.sun.proxy.$Proxy2.stop(Unknown Source)

        at org.gradle.api.internal.tasks.testing.worker.TestWorker.stop(TestWorker.java:132)

        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

        at java.base/java.lang.reflect.Method.invoke(Method.java:564)

        at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:36)

        at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)

        at org.gradle.internal.remote.internal.hub.MessageHubBackedObjectConnection$DispatchWrapper.dispatch(MessageHubBackedObjectConnection.java:182)

        at org.gradle.internal.remote.internal.hub.MessageHubBackedObjectConnection$DispatchWrapper.dispatch(MessageHubBackedObjectConnection.java:164)

        at org.gradle.internal.remote.internal.hub.MessageHub$Handler.run(MessageHub.java:412)

        at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64)

        at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:48)

        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130)

        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630)

        at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:56)

        at java.base/java.lang.Thread.run(Thread.java:832)

EchoTest > initializationError FAILED

    java.lang.NoClassDefFoundError: Could not initialize class org.codehaus.groovy.reflection.ReflectionCache

        at org.codehaus.groovy.runtime.dgmimpl.NumberNumberMetaMethod.<clinit>(NumberNumberMetaMethod.java:33)

        at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

        at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)

        at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)

        at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:500)

        at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:481)

        at org.codehaus.groovy.runtime.metaclass.MetaClassRegistryImpl.createMetaMethodFromClass(MetaClassRegistryImpl.java:258)

        at org.codehaus.groovy.runtime.metaclass.MetaClassRegistryImpl.<init>(MetaClassRegistryImpl.java:111)

        at org.codehaus.groovy.runtime.metaclass.MetaClassRegistryImpl.<init>(MetaClassRegistryImpl.java:86)

        at groovy.lang.GroovySystem.<clinit>(GroovySystem.java:36)

        at org.codehaus.groovy.runtime.InvokerHelper.<clinit>(InvokerHelper.java:86)

        at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.createMap(ScriptBytecodeAdapter.java:635)

        at io.restassured.internal.ResponseParserRegistrar.<init>(ResponseParserRegistrar.groovy)

        at io.restassured.RestAssured.<clinit>(RestAssured.java:347)

        at org.jpos.rest.APITestSupport.setUp(APITestSupport.java:52)

        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

        at java.base/java.lang.reflect.Method.invoke(Method.java:564)

        at org.junit.platform.commons.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:686)

        at org.junit.jupiter.engine.execution.MethodInvocation.proceed(MethodInvocation.java:60)

        at org.junit.jupiter.engine.execution.InvocationInterceptorChain$ValidatingInvocation.proceed(InvocationInterceptorChain.java:131)

        at org.junit.jupiter.engine.extension.TimeoutExtension.intercept(TimeoutExtension.java:149)

        at org.junit.jupiter.engine.extension.TimeoutExtension.interceptLifecycleMethod(TimeoutExtension.java:126)

        at org.junit.jupiter.engine.extension.TimeoutExtension.interceptBeforeAllMethod(TimeoutExtension.java:68)

        at org.junit.jupiter.engine.execution.ExecutableInvoker$ReflectiveInterceptorCall.lambda$ofVoidMethod$0(ExecutableInvoker.java:115)

        at org.junit.jupiter.engine.execution.ExecutableInvoker.lambda$invoke$0(ExecutableInvoker.java:105)

        at org.junit.jupiter.engine.execution.InvocationInterceptorChain$InterceptedInvocation.proceed(InvocationInterceptorChain.java:106)

        at org.junit.jupiter.engine.execution.InvocationInterceptorChain.proceed(InvocationInterceptorChain.java:64)

        at org.junit.jupiter.engine.execution.InvocationInterceptorChain.chainAndInvoke(InvocationInterceptorChain.java:45)

        at org.junit.jupiter.engine.execution.InvocationInterceptorChain.invoke(InvocationInterceptorChain.java:37)

        at org.junit.jupiter.engine.execution.ExecutableInvoker.invoke(ExecutableInvoker.java:104)

        at org.junit.jupiter.engine.execution.ExecutableInvoker.invoke(ExecutableInvoker.java:98)

        at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.lambda$invokeBeforeAllMethods$8(ClassBasedTestDescriptor.java:375)

        at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)

        at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.invokeBeforeAllMethods(ClassBasedTestDescriptor.java:373)

        at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.before(ClassBasedTestDescriptor.java:193)

        at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.before(ClassBasedTestDescriptor.java:78)

        at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$5(NodeTestTask.java:132)

        at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)

        at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$7(NodeTestTask.java:125)

        at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:135)

        at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:123)

        at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)

        at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:122)

        at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:80)

        at java.base/java.util.ArrayList.forEach(ArrayList.java:1510)

        at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:38)

        at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$5(NodeTestTask.java:139)

        at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)

        at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$7(NodeTestTask.java:125)

        at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:135)

        at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:123)

        at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)

        at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:122)

        at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:80)

        at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.submit(SameThreadHierarchicalTestExecutorService.java:32)

        at org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor.execute(HierarchicalTestExecutor.java:57)

        at org.junit.platform.engine.support.hierarchical.HierarchicalTestEngine.execute(HierarchicalTestEngine.java:51)

        at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:220)

        at org.junit.platform.launcher.core.DefaultLauncher.lambda$execute$6(DefaultLauncher.java:188)

        at org.junit.platform.launcher.core.DefaultLauncher.withInterceptedStreams(DefaultLauncher.java:202)

        at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:181)

        at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:128)

        at org.gradle.api.internal.tasks.testing.junitplatform.JUnitPlatformTestClassProcessor$CollectAllTestClassesExecutor.processAllTestClasses(JUnitPlatformTestClassProcessor.java:99)

        at org.gradle.api.internal.tasks.testing.junitplatform.JUnitPlatformTestClassProcessor$CollectAllTestClassesExecutor.access$000(JUnitPlatformTestClassProcessor.java:79)

        at org.gradle.api.internal.tasks.testing.junitplatform.JUnitPlatformTestClassProcessor.stop(JUnitPlatformTestClassProcessor.java:75)

        at org.gradle.api.internal.tasks.testing.SuiteTestClassProcessor.stop(SuiteTestClassProcessor.java:61)

        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

        at java.base/java.lang.reflect.Method.invoke(Method.java:564)

        at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:36)

        at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)

        at org.gradle.internal.dispatch.ContextClassLoaderDispatch.dispatch(ContextClassLoaderDispatch.java:33)

        at org.gradle.internal.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.java:94)

        at com.sun.proxy.$Proxy2.stop(Unknown Source)

        at org.gradle.api.internal.tasks.testing.worker.TestWorker.stop(TestWorker.java:132)

        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

        at java.base/java.lang.reflect.Method.invoke(Method.java:564)

        at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:36)

        at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)

        at org.gradle.internal.remote.internal.hub.MessageHubBackedObjectConnection$DispatchWrapper.dispatch(MessageHubBackedObjectConnection.java:182)

        at org.gradle.internal.remote.internal.hub.MessageHubBackedObjectConnection$DispatchWrapper.dispatch(MessageHubBackedObjectConnection.java:164)

        at org.gradle.internal.remote.internal.hub.MessageHub$Handler.run(MessageHub.java:412)

        at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64)

        at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:48)

        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130)

        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630)

        at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:56)

        at java.base/java.lang.Thread.run(Thread.java:832)

Hi @jameshilliard,
This exception is coming from RestAssured library that you are using due to an older, JDK14 incompatible Groovy version that it transitively uses.
I did overcome this in my project by forcing Groovy to 2.5.10, however, now I see that RestAssured 4.3.0 was released hours ago. It bumped the version of Groovy to 3.0.2 and I just tried it out - RestAssured 4.3.0 works with JDK14.

@rieske Thanks, it's working now after updating RestAssured.

Java 14 is now GA, is Gradle 6.3 still planned for today?

@micpalmia the plan is for early next week. We have a release candidate out now.

Please backport this fix to 5.x series as well!

I am also getting exact same error on OpenJdk 14, Grails 4.0.1 and Gradle 6.1. Hopefully merge request for https://github.com/ScoopInstaller/Versions/pull/199 would get accepted soon.

Same thing for OpenJDK 8-242

Is there a work around for this?

The newest release candidate works fine

On Tue, Mar 24, 2020 at 12:04 PM vinnymoderndemocracy <
[email protected]> wrote:

Is there a work around for this?


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/gradle/gradle/issues/10248#issuecomment-603174000,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AAB4LMROLDABJTW47XBUWWLRJCHR7ANCNFSM4IKXJM5A
.

--

Kind Regards,
Tadas Šubonis

So guys please tell me how to fix it? I am not Java pro and working with NativeScript building app for android. After updating Android Studio i starting to see this error... I have tryied to install Gradle 6.3 but it doe snot help (https://gradle.org/install/)

This is going to affect people like us the most as it is a blocker for anything trying the stack for the first time.

I barely know what I'm doing here so this might not be right...

You nee to upgrade gradle to the RC. In terminal

cd /android

and enter the command

gradle wrapper --gradle-version 6.3-rc-3

This should upgrade you to something that works with Java 14 JDK

@vinnymoderndemocracy where is that /android folder? :))))

@vinnymoderndemocracy where is that /android folder? :))))

Sorry it is in your React Native project folder

i am using nativescript :)

It's a similar idea. You'll have to work out yourself how to upgrade Gradle then 👍

Also i do no tunderstand why Gradle 6.3-rc-3 if normal 6,3 is released....

Also i do no tunderstand why Gradle 6.3-rc-3 if normal 6,3 is released....

Upgrading to the latest Gradle 6.3 should work. I had a similar issue earlier this week, and upgrading to Gradle 6.3 worked for me.

i installed gradle and added to enviornment variables but looks like nativescript uses 3.5.1

@vytautas-pranskunas- I am not familiar with NativeScript. If you can't force an upgrade of Gradle, then I guess it is up to NativeScript to provide the right version of Gradle. Maybe you should report this issue to NativeScript.

@vytautas-pranskunas- I also have never used native script, but if you installed Gradle 6.3 and native script still compiles with 3.5.1, it looks like you have installed/updated a Gradle installation on your machine while the build is using the Gradle wrapper included in the project. Please read up on "Gradle wrapper" for more info.

In short: if you start your build by invoking gradlew, gradlew.bat (Windows) or ./gradlew (Mac, Linux), then you are using the Gradle wrapper and the Gradle installation on your machine shouldn't effect the build in any way. You can then run your machine's Gradle (make sure it's on the path, and run gradle without the 'w' at the end) and hope the build script is still compatible with that. If it works, you can update the wrapper yourself or open an issue in the nativescript project for this.

PS: if I look into the NativeScript repository, they switched to gradle-5.4.1 8 months ago. Could your NativeScript be outdated?

@xzel23 those gradelw files are generated by nativescript during build step.
sry it was gradle tools version and gradle is 5.4.1 you are right.

gradle build starts automatically when building for android... so i guess it is nativescrit issue then to update everything

another question - how can i dongrade my JDK (which version should i take), and Gradle to 5.4.1?

Hello guys, I am React Native developer. So will upgrading Gradle to 6.3 fix this error ?

@vytautas-pranskunas- Gradle 5.4.1 release notes say that it's JDK 12 compatible. But downgrading to JDK 12 does not really make much sense - it's outdated. You should either use JDK 14 (which is the current version) or JDK 11 (which has long term support), and since JDK 14 doesn't work for your project, take JDK 11.

You can also have several JDK versions installed in parallel, but I think that's really rather an option if you are into Java development.

I think it might not be not necessary to downgrade your Gradle installation though, because it won't be used anyway. If the project is configured correctly, you shouldn't need an installation of Gradle at all to build it.

I do a lot of Java development and use Gradle everyday, but I have stopped using a (machine wide) local installation months ago. So, I'd probably just uninstall Gradle from your machine.

I do not know what it is happening but i downgraded to JDK 11, then upgradet to JDK 12 but feeling that nothing changed - same error:
Could not initialize class org.codehaus.groovy.vmplugin.v7.Java7

any ideas?

Is JDK8 an option for you?

On Fri, Mar 27, 2020 at 6:38 AM Vytautas Pranskunas <
[email protected]> wrote:

I do not know what it is happening but i downgraded to JDK 11, then
upgradet to JDK 12 but feeling that nothing changed - a bit different error
but build is failing anayway:
Could not initialize class org.codehaus.groovy.reflection.ReflectionCache

any ideas?


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/gradle/gradle/issues/10248#issuecomment-604672669,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AACELUDFWUMCNNDINWQLNPTRJO4N3ANCNFSM4IKXJM5A
.

post the output of java -version, javac -version, and gradlew -version (run that command in the directory containing the gradle wrapper of your project).

As a React Native developer, I upgraded the gradle to 6.3 as suggested above and it fixed my problem.
Java version: java 14 2020-03-17
React Native version: 0.61.5

Upgrade gradle to 6.3:
In gradle-wrapper.properties: change the line to:
distributionUrl=https\://services.gradle.org/distributions/gradle-6.3-all.zip

@guofoo , How did you updated/upgraded gradle? I am new to android studio and React Native.
The error I am getting is this:

`FAILURE: Build failed with an exception.
* What went wrong:
Could not initialize class org.codehaus.groovy.reflection.ReflectionCache
* 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.`

@Prottoy2938

I've been trying to get around this issue in the last three days. I just did what @guofoo suggested and it works like charm .

Just go to the gradle-wrapper.properties located under android>>gradle/wrapper
and change the gradle version to 6.3 (in my case it was 5.5)

It was like this:
distributionUrl=https\://services.gradle.org/distributions/gradle-5.5-all.zip

Changed to this:
distributionUrl=https\://services.gradle.org/distributions/gradle-6.3-all.zip

Compile and it should work.

Thanks a lot to @guofoo 🙏 🙏 🙏

can confirm, gradle 6.3 fixed the java.lang.NoClassDefFoundError: Could not initialize class org.codehaus.groovy.vmplugin.v7.Java7 error for me!

'Could not initialize class org.codehaus.groovy.classgen.Verifier'

openjdk version "14" 2020-03-17
OpenJDK Runtime Environment (build 14+36-1461)
OpenJDK 64-Bit Server VM (build 14+36-1461, mixed mode, sharing)

IntelliJ IDEA 2019.3.4 (Ultimate Edition)
Build #IU-193.6911.18, built on March 17, 2020
Licensed to Roger Lee
You have a perpetual fallback license for this version
Subscription is active until April 5, 2021
Runtime version: 11.0.6+8-b520.43 x86_64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
macOS 10.15.4
GC: ParNew, ConcurrentMarkSweep
Memory: 1979M
Cores: 16
Registry:
Non-Bundled Plugins: CheckStyle-IDEA, FindBugs-IDEA, io.ktor.intellij.plugin

@NOTiFYcouk Do you get this when running your build from command line or within IntelliJ? In IntelliJ, you should make sure that you are using the correct Gradle version (preferences/build, execution, deployment/buil tools/gradle) and make sure that "Use Gradle from" is set to use the latest version (I use 'use-cradle-wrapper.properties file' and update the wrapper manually).

Unable to build the project : Keep getting this below error:

Failed to execute goal org.springframework.cloud:spring-cloud-contract-maven-plugin:2.2.1.RELEASE:generateTests (default-generateTests) on project creditcheckservice: Unable to parse configuration of mojo org.springframework.cloud:spring-cloud-contract-maven-plugin:2.2.1.RELEASE:generateTests for parameter testFramework: Cannot set 'testFramework' in class org.springframework.cloud.contract.maven.verifier.GenerateTestsMojo

Even i got the above said error 'Could not initialize class org.codehaus.groovy.classgen.Verifier'

I am using JDK14 and IntellIj updated to support JDK14..
Can someone please let me know what i am supposed to do in this case. I am new to this JAVA world. Kindly have a look into the issue. If needed more info please let me know

I fought with this issue all day. Finally got it to work for me in Intellij using the following:
Screen Shot 2020-04-10 at 5 19 37 PM

Thanks for your reply.
I tried checking the setting. But for me, it looks like as shown below. From where I can find the Gradle project settings?
image

I have installed the latest version of Gradle which solved the issue.Thanks, Russ Ray

As a React Native developer, I upgraded the gradle to 6.3 as suggested above and it fixed my problem.
Java version: java 14 2020-03-17
React Native version: 0.61.5

Upgrade gradle to 6.3:
In gradle-wrapper.properties: change the line to:
distributionUrl=https\://services.gradle.org/distributions/[gradle-6](https://issues.gradle.org/browse/GRADLE-6).3-all.zip

exception has been clean~

The version has been updated in react-native but is yet to be released. https://github.com/facebook/react-native/pull/28173

I have upgraded to 6.4.1 and use java 14, but still get the issue:

$ ./gradlew -version

------------------------------------------------------------
Gradle 6.4.1
------------------------------------------------------------

Build time:   2020-05-15 19:43:40 UTC
Revision:     1a04183c502614b5c80e33d603074e0b4a2777c5

Kotlin:       1.3.71
Groovy:       2.5.10
Ant:          Apache Ant(TM) version 1.10.7 compiled on September 1 2019
JVM:          14.0.1 (Oracle Corporation 14.0.1+7)
OS:           Mac OS X 10.14.6 x86_64
$ ./gradlew clean build
Processing File 1 of 43 - jquery-3.3.1.min.js
Processing File 4 of 43 - bootstrap.bundle.min.js
Processing File 5 of 43 - bootstrap.min.js
Processing File 3 of 43 - bootstrap.js
...
Processing File 43 of 43 - bootstrap.min.css.map

> Task :assetCompile
Finished Precompiling Assets

> Task :compileGroovy FAILED
java.lang.NoClassDefFoundError: Could not initialize class org.codehaus.groovy.vmplugin.v7.Java7
        at org.codehaus.groovy.vmplugin.VMPluginFactory.<clinit>(VMPluginFactory.java:43)
        at org.codehaus.groovy.reflection.GroovyClassValueFactory.<clinit>(GroovyClassValueFactory.java:35)
        at org.codehaus.groovy.reflection.ClassInfo.<clinit>(ClassInfo.java:107)
        at org.codehaus.groovy.reflection.ReflectionCache.getCachedClass(ReflectionCache.java:95)
        at org.codehaus.groovy.reflection.ReflectionCache.<clinit>(ReflectionCache.java:39)
        at org.codehaus.groovy.runtime.metaclass.MetaClassRegistryImpl.registerMethods(MetaClassRegistryImpl.java:209)
        at org.codehaus.groovy.runtime.metaclass.MetaClassRegistryImpl.<init>(MetaClassRegistryImpl.java:107)
        at org.codehaus.groovy.runtime.metaclass.MetaClassRegistryImpl.<init>(MetaClassRegistryImpl.java:85)
        at groovy.lang.GroovySystem.<clinit>(GroovySystem.java:36)
        at org.gradle.api.internal.tasks.compile.ApiGroovyCompiler.parseGroovyVersion(ApiGroovyCompiler.java:325)
        at org.gradle.api.internal.tasks.compile.ApiGroovyCompiler.execute(ApiGroovyCompiler.java:168)
        at org.gradle.api.internal.tasks.compile.ApiGroovyCompiler.execute(ApiGroovyCompiler.java:68)
        at org.gradle.api.internal.tasks.compile.GroovyCompilerFactory$DaemonSideCompiler.execute(GroovyCompilerFactory.java:94)
        at org.gradle.api.internal.tasks.compile.GroovyCompilerFactory$DaemonSideCompiler.execute(GroovyCompilerFactory.java:75)
        at org.gradle.api.internal.tasks.compile.daemon.AbstractDaemonCompiler$CompilerWorkAction.execute(AbstractDaemonCompiler.java:135)
        at org.gradle.workers.internal.DefaultWorkerServer.execute(DefaultWorkerServer.java:63)
        at org.gradle.workers.internal.AbstractClassLoaderWorker$1.create(AbstractClassLoaderWorker.java:48)
        at org.gradle.workers.internal.AbstractClassLoaderWorker$1.create(AbstractClassLoaderWorker.java:42)
        at org.gradle.internal.classloader.ClassLoaderUtils.executeInClassloader(ClassLoaderUtils.java:98)
        at org.gradle.workers.internal.AbstractClassLoaderWorker.executeInClassLoader(AbstractClassLoaderWorker.java:42)
        at org.gradle.workers.internal.IsolatedClassloaderWorker.run(IsolatedClassloaderWorker.java:49)
        at org.gradle.workers.internal.IsolatedClassloaderWorker.run(IsolatedClassloaderWorker.java:30)
        at org.gradle.workers.internal.WorkerDaemonServer.run(WorkerDaemonServer.java:85)
        at org.gradle.workers.internal.WorkerDaemonServer.run(WorkerDaemonServer.java:55)
        at org.gradle.process.internal.worker.request.WorkerAction$1.call(WorkerAction.java:136)
        at org.gradle.process.internal.worker.child.WorkerLogEventListener.withWorkerLoggingProtocol(WorkerLogEventListener.java:41)
        at org.gradle.process.internal.worker.request.WorkerAction.run(WorkerAction.java:133)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:564)
        at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:36)
        at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
        at org.gradle.internal.remote.internal.hub.MessageHubBackedObjectConnection$DispatchWrapper.dispatch(MessageHubBackedObjectConnection.java:182)
        at org.gradle.internal.remote.internal.hub.MessageHubBackedObjectConnection$DispatchWrapper.dispatch(MessageHubBackedObjectConnection.java:164)
        at org.gradle.internal.remote.internal.hub.MessageHub$Handler.run(MessageHub.java:413)
        at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64)
        at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:48)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630)
        at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:56)
        at java.base/java.lang.Thread.run(Thread.java:832)

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':compileGroovy'.
> Could not initialize class org.codehaus.groovy.reflection.ReflectionCache

* 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

Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.4.1/userguide/command_line_interface.html#sec:command_line_warnings

BUILD FAILED in 10s
3 actionable tasks: 3 executed

The only difference I can see is the JDK. I use:

java -version

openjdk version "14" 2020-03-17
OpenJDK Runtime Environment (build 14+36-1461)
OpenJDK 64-Bit Server VM (build 14+36-1461, mixed mode, sharing)

The only difference I can see is the JDK. I use:

java -version

openjdk version "14" 2020-03-17
OpenJDK Runtime Environment (build 14+36-1461)
OpenJDK 64-Bit Server VM (build 14+36-1461, mixed mode, sharing)

I'll try with that JDK.

how exactly did you get that version on your mac? I tried using sdk install java 14.0.1.j9-adpt but that gives me:

$ java -version
openjdk version "14.0.1" 2020-04-14
OpenJDK Runtime Environment AdoptOpenJDK (build 14.0.1+7)
Eclipse OpenJ9 VM AdoptOpenJDK (build openj9-0.20.0, JRE 14 Mac OS X amd64-64-Bit Compressed References 20200416_40 (JIT enabled, AOT enabled)
OpenJ9   - 05fa2d361
OMR      - d4365f371
JCL      - 5757187cae based on jdk-14.0.1+7)

It seems you are using the commercial oracle jdk I guess, hmm? But even when I use that, I get the version I showed you above.

$ ./gradlew -version

------------------------------------------------------------
Gradle 6.4.1
------------------------------------------------------------

Build time:   2020-05-15 19:43:40 UTC
Revision:     1a04183

Kotlin:       1.3.71
Groovy:       2.5.10
Ant:          Apache Ant(TM) version 1.10.7 compiled on September 1 2019
JVM:          14.0.1 (Oracle Corporation 14.0.1+7)
OS:           Mac OS X 10.14.6 x86_64

https://openjdk.java.net/
https://jdk.java.net/14/

Compiled and added into macOS:

Macintosh HD / Library / Java / JavaVirtualMachines / jdk-14.jdk

I'm not sure I understand. You compiled it yourself and then added it? Why wouldn't you use one of the already built and released versions for macOS? Is it recommended to do that now? If I follow your links, it talks about the Oracle JDK for private, non-commercial usage, and I tried that but it asks me to accept a license agreement, but I can't find how one would actually do that.
A lot of the people I've been following recommend using sdk-man. I've been trying that, but having little success with the 4 jvms I've tried from there so far too.
I'm looking to see if I can use Grails 4.0.1 (or better) with jdk 14, e.g. But I'm about ready to give up and go back to 1.8 which works and runs my application. So many troubles to try and use 14.

FWIW, the OpenJDK 14.0.1 build at https://jdk.java.net/14/ is a GPL licensed build of OpenJDK 14.0.1 that you can use for commercial or non-commercial applications. It's under the same license that you or anyone else building from sources would get.

I just tried that same OpenJDK 14.0.1 build, and it works fine for me building OpenJFX. I suspect that your problem is something else. Based on the error message, you might have a dependency in your project on an older version of Groovy. Not sure though.

Yeah, makes sense. Thank you for trying that out and reporting back.I don't probably need to try out any more flavors of jdk 14 now.Grails doesn't say it won't work with 14, in fact it says 8+, but, I'm guessing they've never tested it. I'll probably give up at this point and just use 8, maybe try 11.On May 20, 2020 6:05 PM, Kevin Rushforth notifications@github.com wrote:
FWIW, the OpenJDK 14.0.1 build at https://jdk.java.net/14/ is a GPL licensed build of OpenJDK 14.0.1 that you can use for commercial or non-commercial applications. It's under the same license that you or anyone else building from sources would get.
I just tried that same OpenJDK 14.0.1 build, and it works fine for me building OpenJFX. I suspect that your problem is something else. Based on the error message, you might have a dependency in your project on an older version of Groovy. Not sure though.

—You are receiving this because you commented.Reply to this email directly, view it on GitHub, or unsubscribe.

https://openjdk.java.net/
https://jdk.java.net/14/

Compiled and added into macOS:

Macintosh HD / Library / Java / JavaVirtualMachines / jdk-14.jdk

I had the same issue as you.

I had to change the gradle-wrapper.properties from 6.0.1 to 6.4.1 in android > gradle > wrapper

distributionUrl=https\://services.gradle.org/distributions/gradle-6.4.1-all.zip

Still doesn't work for me.

Kotlin:       1.3.41
Groovy:       2.5.4
Ant:          Apache Ant(TM) version 1.9.14 compiled on March 12 2019
JVM:          14 (Oracle Corporation 14+36-1461)
OS:           Mac OS X 10.15.3 x86_64

distributionUrl=https\://services.gradle.org/distributions/gradle-6.4.1-all.zip

I downloaded / installed gradle 6.4.1 and configure the Intellij to use the latest version of Gradle, it seems works.

  1. Download & install the gradle 6.4.1
  2. Config the IntelliJ to use the 6.4.1
    image

Alternatively, type gradlew wrapper --gradle-version=6.4.1 in the Terminal window of IntelliJ.

@aingarant Life saver mate! Thank you 👍

I ran gradlew wrapper --gradle-version=6.5 but I was still getting the same error, though the stacktrace was different. When I changed Groovy dependency from 2.5.7 to 2.5.11, it went away. Here is the stacktrace with Gradle 6.5 and Groovy 2.5.7:

java.lang.NoClassDefFoundError: Could not initialize class org.codehaus.groovy.vmplugin.v7.Java7
        at org.codehaus.groovy.vmplugin.VMPluginFactory.<clinit>(VMPluginFactory.java:43)
        at org.codehaus.groovy.reflection.GroovyClassValueFactory.<clinit>(GroovyClassValueFactory.java:35)
        at org.codehaus.groovy.reflection.ClassInfo.<clinit>(ClassInfo.java:107)
        at org.codehaus.groovy.reflection.ReflectionCache.getCachedClass(ReflectionCache.java:95)
        at org.codehaus.groovy.reflection.ReflectionCache.<clinit>(ReflectionCache.java:39)
        at org.codehaus.groovy.runtime.metaclass.MetaClassRegistryImpl.registerMethods(MetaClassRegistryImpl.java:209)
        at org.codehaus.groovy.runtime.metaclass.MetaClassRegistryImpl.<init>(MetaClassRegistryImpl.java:107)
        at org.codehaus.groovy.runtime.metaclass.MetaClassRegistryImpl.<init>(MetaClassRegistryImpl.java:85)
        at groovy.lang.GroovySystem.<clinit>(GroovySystem.java:36)
        at org.gradle.api.internal.tasks.compile.ApiGroovyCompiler.parseGroovyVersion(ApiGroovyCompiler.java:324)
        at org.gradle.api.internal.tasks.compile.ApiGroovyCompiler.execute(ApiGroovyCompiler.java:167)
        at org.gradle.api.internal.tasks.compile.ApiGroovyCompiler.execute(ApiGroovyCompiler.java:67)
        at org.gradle.api.internal.tasks.compile.GroovyCompilerFactory$DaemonSideCompiler.execute(GroovyCompilerFactory.java:98)
        at org.gradle.api.internal.tasks.compile.GroovyCompilerFactory$DaemonSideCompiler.execute(GroovyCompilerFactory.java:77)
        at org.gradle.api.internal.tasks.compile.daemon.AbstractDaemonCompiler$CompilerWorkAction.execute(AbstractDaemonCompiler.java:135)
        at org.gradle.workers.internal.DefaultWorkerServer.execute(DefaultWorkerServer.java:63)
        at org.gradle.workers.internal.AbstractClassLoaderWorker$1.create(AbstractClassLoaderWorker.java:49)
        at org.gradle.workers.internal.AbstractClassLoaderWorker$1.create(AbstractClassLoaderWorker.java:43)
        at org.gradle.internal.classloader.ClassLoaderUtils.executeInClassloader(ClassLoaderUtils.java:97)
        at org.gradle.workers.internal.AbstractClassLoaderWorker.executeInClassLoader(AbstractClassLoaderWorker.java:43)
        at org.gradle.workers.internal.IsolatedClassloaderWorker.run(IsolatedClassloaderWorker.java:49)
        at org.gradle.workers.internal.IsolatedClassloaderWorker.run(IsolatedClassloaderWorker.java:30)
        at org.gradle.workers.internal.WorkerDaemonServer.run(WorkerDaemonServer.java:85)
        at org.gradle.workers.internal.WorkerDaemonServer.run(WorkerDaemonServer.java:55)
        at org.gradle.process.internal.worker.request.WorkerAction$1.call(WorkerAction.java:138)
        at org.gradle.process.internal.worker.child.WorkerLogEventListener.withWorkerLoggingProtocol(WorkerLogEventListener.java:41)
        at org.gradle.process.internal.worker.request.WorkerAction.run(WorkerAction.java:135)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:564)
        at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:36)
        at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
        at org.gradle.internal.remote.internal.hub.MessageHubBackedObjectConnection$DispatchWrapper.dispatch(MessageHubBackedObjectConnection.java:182)
        at org.gradle.internal.remote.internal.hub.MessageHubBackedObjectConnection$DispatchWrapper.dispatch(MessageHubBackedObjectConnection.java:164)
        at org.gradle.internal.remote.internal.hub.MessageHub$Handler.run(MessageHub.java:414)
        at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64)
        at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:48)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630)
        at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:56)
        at java.base/java.lang.Thread.run(Thread.java:832)

I'm using gradle v6.5 and openjdk version "14.0.1" 2020-04-14
OpenJDK Runtime Environment (build 14.0.1+7)
OpenJDK 64-Bit Server VM (build 14.0.1+7, mixed mode, sharing)

still won't work!

Still doesn't work for me.

Kotlin:       1.3.41
Groovy:       2.5.4
Ant:          Apache Ant(TM) version 1.9.14 compiled on March 12 2019
JVM:          14 (Oracle Corporation 14+36-1461)
OS:           Mac OS X 10.15.3 x86_64

distributionUrl=https\://services.gradle.org/distributions/[gradle-6](https://issues.gradle.org/browse/GRADLE-6).4.1-all.zip

This worked for me.

https://openjdk.java.net/
https://jdk.java.net/14/
Compiled and added into macOS:
Macintosh HD / Library / Java / JavaVirtualMachines / jdk-14.jdk

I had the same issue as you.

I had to change the gradle-wrapper.properties from 6.0.1 to 6.4.1 in android > gradle > wrapper

distributionUrl=https\://services.gradle.org/distributions/[gradle-6](https://issues.gradle.org/browse/GRADLE-6).4.1-all.zip

This worked for me for the below error.

What went wrong:
Could not initialize class org.codehaus.groovy.runtime.InvokerHelper

distributionUrl=https\://services.gradle.org/distributions/[[gradle-6](https://issues.gradle.org/browse/GRADLE-6)](https://issues.gradle.org/browse/[GRADLE-6](https://issues.gradle.org/browse/GRADLE-6)).4.1-all.zip

This worked for me.

@gzepeda do you think you could ELI5 how to do this?

Same problem for me on mac with gradle 6.5 and openjdk 14.0.1 :(

i just built a starter project using spring initializer. i specified maven as the project. I am using intellij.

What does it have to do with Gradle? This issue is about the Groovy version used by Gradle and has been fixed for some time. Your problem is with maven, spring, or whatever.

thank you!

Updating from
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.2-bin.zip
to
distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-bin.zip
in
myproject/gradle/wrapper/gradle-wrapper.properties
solved this for me.

Ubuntu 20.04 LTS

@michaelhochleitner Thank you so much!

Updating [...] to
distributionUrl=https\://services.gradle.org/distributions/[gradle-6](https://issues.gradle.org/browse/GRADLE-6).5-bin.zip
in myproject/gradle/wrapper/gradle-wrapper.properties
solved this for me.

Ubuntu 20.04 LTS

For me on MacOS 10.15.5, I edited myReactNativeProject/android/gradle/wrapper/gradle-wrapper.properties and changed the following value (original value commented out with #):

# distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-all.zip

I was also facing the same issue with java 14 in flutter application

5

you just need to update the gradle-wrapper.properties with the new version of gradle

Annotation 2020-06-24 100601
2

Once it is done you can run your command on terminal as gradlew signingReport

3

It is working fine now

4

Thank you @Nik4u22, worked for me.

I used latest gradle:

https\://services.gradle.org/distributions/gradle-6.5-all.zip

Updating from
distributionUrl=https\://services.gradle.org/distributions/[gradle-5](https://issues.gradle.org/browse/GRADLE-5).6.2-bin.zip
to
distributionUrl=https\://services.gradle.org/distributions/[gradle-6](https://issues.gradle.org/browse/GRADLE-6).5-bin.zip
in
myproject/gradle/wrapper/gradle-wrapper.properties
solved this for me.

Ubuntu 20.04 LTS

it works fine with me.

How to make it permanent? in this case, I have to do this action for every single project.
thanx

export JAVA_HOME=`/usr/libexec/java_home -v 1.8`
./gradlew lint

Error still appearing:

Task :jme3-core:compileTestGroovy FAILED
java.lang.NoClassDefFoundError: Could not initialize class org.codehaus.groovy.vmplugin.v7.Java7

java:
openjdk 14.0.1 2020-04-14
OpenJDK Runtime Environment (build 14.0.1+7-Ubuntu-1ubuntu1)
OpenJDK 64-Bit Server VM (build 14.0.1+7-Ubuntu-1ubuntu1, mixed mode, sharing)
os:
Description: Ubuntu 20.04.1 LTS

gradle changed in:
.../jMonkeyEngine.sdk.GIT/engine/gradle/wrapper/gradle-wrapper.properties
.../jMonkeyEngine.sdk.GIT/gradle/wrapper/gradle-wrapper.properties
to:
distributionUrl=https\://services.gradle.org/distributions/gradle-6.6.1-bin.zip

I got the same issue on my Android Emulator. How I solved it? Navigate to
MyAwesomeProject > android > gradle / wrapper > gradle-wrapper.properties
Then, update

    distributionBase=GRADLE_USER_HOME
    distributionPath=wrapper/dists

- distributionUrl=https\://services.gradle.org/distributions/gradle-6.2-all.zip
+ distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

After updating 2 to 5, then run npx react-native run-android
and your project will run just fine.

I got the same issue on my Android Emulator. How I solved it? Navigate to
MyAwesomeProject > android > gradle / wrapper > gradle-wrapper.properties
Then, update

    distributionBase=GRADLE_USER_HOME
    distributionPath=wrapper/dists
  • distributionUrl=https\://services.gradle.org/distributions/gradle-6.2-all.zip
    
  • distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-all.zip
    zipStoreBase=GRADLE_USER_HOME
    zipStorePath=wrapper/dists
    

After updating 2 to 5, then run npx react-native run-android
and your project will run just fine.

Thanks man! after bashing hours of hours, installing & uninstalling packages/apps I found your soultions, and it worked finally 👍 !

Was this page helpful?
0 / 5 - 0 ratings

Related issues

lacasseio picture lacasseio  ·  102Comments

bsideup picture bsideup  ·  115Comments

bmuschko picture bmuschko  ·  52Comments

cjdxhjj picture cjdxhjj  ·  43Comments

p- picture p-  ·  36Comments