Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JDK 14 support #10248

Closed
kevinrushforth opened this issue Aug 9, 2019 · 122 comments
Closed

JDK 14 support #10248

kevinrushforth opened this issue Aug 9, 2019 · 122 comments
Assignees
Labels
a:bug @core
Milestone

Comments

@kevinrushforth
Copy link

@kevinrushforth kevinrushforth commented Aug 9, 2019

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
@sdfelts
Copy link

@sdfelts sdfelts commented Aug 9, 2019

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).

@kevinrushforth
Copy link
Author

@kevinrushforth kevinrushforth commented Aug 9, 2019

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.

@sdfelts
Copy link

@sdfelts sdfelts commented Aug 9, 2019

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.

@sdfelts
Copy link

@sdfelts sdfelts commented Aug 9, 2019

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.

@sdfelts
Copy link

@sdfelts sdfelts commented Aug 9, 2019

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.

@AlanBateman
Copy link

@AlanBateman AlanBateman commented Aug 12, 2019

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.

@AlanBateman
Copy link

@AlanBateman AlanBateman commented Aug 13, 2019

GROOVY-9211

@aguibert
Copy link

@aguibert aguibert commented Nov 5, 2019

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.

@brunoborges
Copy link

@brunoborges brunoborges commented Nov 21, 2019

Gradle 6.0.1 continues to fail on this.

@obi0ne
Copy link

@obi0ne obi0ne commented Dec 9, 2019

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

@juergenzimmermann
Copy link

@juergenzimmermann juergenzimmermann commented Dec 17, 2019

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

@nigel447
Copy link

@nigel447 nigel447 commented Dec 17, 2019

getting this exact issue for
Gradle 6.0.1
Build time: 2019-11-18 20:25:01 UTC
Revision: fad1210
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

@SlyDen
Copy link

@SlyDen SlyDen commented Dec 27, 2019

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

@cocorossello
Copy link

@cocorossello cocorossello commented Jan 11, 2020

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

@juergenzimmermann
Copy link

@juergenzimmermann juergenzimmermann commented Jan 15, 2020

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

@rgoldberg
Copy link
Contributor

@rgoldberg rgoldberg commented Jan 25, 2020

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)?

@dreis2211
Copy link
Contributor

@dreis2211 dreis2211 commented Jan 25, 2020

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

@dreis2211
Copy link
Contributor

@dreis2211 dreis2211 commented Jan 28, 2020

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.

@masuch
Copy link

@masuch masuch commented Sep 8, 2020

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

@samchidi2005
Copy link

@samchidi2005 samchidi2005 commented Sep 17, 2020

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.

asadmanji added a commit to uberto/okotta-es that referenced this issue Sep 28, 2020
glysbaysb pushed a commit to glysbaysb/dotfiles that referenced this issue Sep 30, 2020
gradle < 6.3 and openjdk14 don't work gradle/gradle#10248
dwoffinden added a commit to dwoffinden/KISS that referenced this issue Oct 2, 2020
The old version failed for me on JRE 14:
gradle/gradle#10248
dwoffinden added a commit to dwoffinden/KISS that referenced this issue Oct 4, 2020
The old version failed for me on JRE 14:
gradle/gradle#10248
@TechiePriyaRanjan
Copy link

@TechiePriyaRanjan TechiePriyaRanjan commented Nov 1, 2020

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 👍 !

jamesdh added a commit to jamesdh/gorm-graphql that referenced this issue Dec 16, 2020
Until we update Gradle and can get around gradle/gradle#10248
@ishitavig
Copy link

@ishitavig ishitavig commented Jan 6, 2021

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.

this worked like magic! thank you!

@falk-stefan
Copy link

@falk-stefan falk-stefan commented Jan 8, 2021

Got the same issue for an empty project.

Question on stackoverflow here

M1cha added a commit to M1cha/youtube-tv that referenced this issue Jan 8, 2021
this makes this work with JDK 14
gradle/gradle#10248
@samruddh
Copy link

@samruddh samruddh commented Jan 11, 2021

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.

Thank you so much, I wasted two days for this thing

meelapshah added a commit to meelapshah/react-native-traceroute that referenced this issue Jan 18, 2021
I was seeing this error (even though I am using java 8)
gradle/gradle#10248
@vladalx
Copy link

@vladalx vladalx commented Jan 20, 2021

16 months later and the issue is not solved. Good work.

@sanyashvets
Copy link

@sanyashvets sanyashvets commented Jan 26, 2021

agreed.

@AdnanKazi
Copy link

@AdnanKazi AdnanKazi commented Feb 5, 2021

When will this issue get resolved most of the developers are waiting for this

@rieske
Copy link
Contributor

@rieske rieske commented Feb 5, 2021

Java 14 support was implemented and released with Gradle 6.3.
If you want to run Gradle with Java 14, please make sure that you are using Gradle 6.3 or later.

@gradle gradle locked as resolved and limited conversation to collaborators Feb 5, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
a:bug @core
Projects
None yet
Development

No branches or pull requests