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

Upgrade to Groovy 2.4.12 for full Java 9 compatibility #2995

Closed
blindpirate opened this issue Sep 22, 2017 · 33 comments
Closed

Upgrade to Groovy 2.4.12 for full Java 9 compatibility #2995

blindpirate opened this issue Sep 22, 2017 · 33 comments
Assignees
Milestone

Comments

@blindpirate
Copy link
Member

@blindpirate blindpirate commented Sep 22, 2017

Expected Behavior

Gradle supports Oracle JDK 9 fully.

Current Behavior

Gradle doesn't support Oracle JDK 9 fully.

Context

JDK 9 final has been released, however, looks like Gradle isn't fully compatible with it.

This is due to the usage of new ElementType.MODULE. Groovy 2.4.12 seems to support MODULE but 2.4.11 doesn't.

Steps to Reproduce (for bugs)

Install Oracle JDK9, and run ./gradlew check in Gradle project.

$ ./gradlew check -s
Parallel execution is an incubating feature.

> Task :buildSrc:compileGroovy
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.codehaus.groovy.reflection.CachedClass (file:/Users/zhb/.gradle/wrapper/dists/gradle-4.2-bin/cl9xe1l8k8ophj72k8rv6xbu7/gradle-4.2/lib/groovy-all-2.4.11.jar) to method java.lang.Object.finalize()
WARNING: Please consider reporting this to the maintainers of org.codehaus.groovy.reflection.CachedClass
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release


FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':buildSrc:compileGroovy'.
> BUG! exception in phase 'class generation' in source unit '/Users/zhb/Projects/gradle2/buildSrc/src/main/groovy/org/gradle/plugins/classycle/Classycle.groovy' unsupported Target MODULE

* Try:
Run with --info or --debug option to get more log output.

* Exception is:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':buildSrc:compileGroovy'.
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:100)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:70)
        at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:62)
        at org.gradle.api.internal.tasks.execution.ResolveTaskOutputCachingStateExecuter.execute(ResolveTaskOutputCachingStateExecuter.java:54)
        at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:58)
        at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:97)
        at org.gradle.api.internal.tasks.execution.CleanupStaleOutputsExecuter.execute(CleanupStaleOutputsExecuter.java:87)
        at org.gradle.api.internal.tasks.execution.ResolveTaskArtifactStateTaskExecuter.execute(ResolveTaskArtifactStateTaskExecuter.java:52)
        at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:52)
        at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:54)
        at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)
        at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:34)
        at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker$1.run(DefaultTaskGraphExecuter.java:248)
        at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:336)
        at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:328)
        at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:199)
        at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:110)
        at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:241)
        at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:230)
        at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.processTask(DefaultTaskPlanExecutor.java:123)
        at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.access$200(DefaultTaskPlanExecutor.java:79)
        at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:104)
        at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:98)
        at org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.execute(DefaultTaskExecutionPlan.java:625)
        at org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.executeWithTask(DefaultTaskExecutionPlan.java:580)
        at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.run(DefaultTaskPlanExecutor.java:98)
        at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)
        at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:46)
        at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55)
Caused by: BUG! exception in phase 'class generation' in source unit '/Users/zhb/Projects/gradle2/buildSrc/src/main/groovy/org/gradle/plugins/classycle/Classycle.groovy' unsupported Target MODULE
        at org.gradle.api.internal.tasks.compile.ApiGroovyCompiler.execute(ApiGroovyCompiler.java:174)
        at org.gradle.api.internal.tasks.compile.ApiGroovyCompiler.execute(ApiGroovyCompiler.java:56)
        at org.gradle.api.internal.tasks.compile.daemon.AbstractDaemonCompiler$CompilerRunnable.run(AbstractDaemonCompiler.java:87)
        at org.gradle.workers.internal.DefaultWorkerServer.execute(DefaultWorkerServer.java:36)
        at org.gradle.workers.internal.WorkerDaemonServer.execute(WorkerDaemonServer.java:46)
        at org.gradle.workers.internal.WorkerDaemonServer.execute(WorkerDaemonServer.java:30)
        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 org.gradle.process.internal.worker.request.WorkerAction.run(WorkerAction.java:100)
        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 org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:35)
        at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
        at org.gradle.internal.remote.internal.hub.MessageHubBackedObjectConnection$DispatchWrapper.dispatch(MessageHubBackedObjectConnection.java:146)
        at org.gradle.internal.remote.internal.hub.MessageHubBackedObjectConnection$DispatchWrapper.dispatch(MessageHubBackedObjectConnection.java:128)
        at org.gradle.internal.remote.internal.hub.MessageHub$Handler.run(MessageHub.java:404)
        ... 3 more


* Get more help at https://help.gradle.org

BUILD FAILED in 8s

Your Environment

./gradlew -v
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.codehaus.groovy.reflection.CachedClass (file:/Users/zhb/.gradle/wrapper/dists/gradle-4.2-bin/cl9xe1l8k8ophj72k8rv6xbu7/gradle-4.2/lib/groovy-all-2.4.11.jar) to method java.lang.Object.finalize()
WARNING: Please consider reporting this to the maintainers of org.codehaus.groovy.reflection.CachedClass
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release

------------------------------------------------------------
Gradle 4.2
------------------------------------------------------------

Build time:   2017-09-20 14:48:23 UTC
Revision:     5ba503cc17748671c83ce35d7da1cffd6e24dfbd

Groovy:       2.4.11
Ant:          Apache Ant(TM) version 1.9.6 compiled on June 29 2015
JVM:          9 (Oracle Corporation 9+181)
OS:           Mac OS X 10.12.1 x86_64

Note the warning in the top.

@blindpirate blindpirate changed the title Compatibility issue with Oracle JDK9 Use Groovy 2.4.12 Sep 22, 2017
@oehme oehme changed the title Use Groovy 2.4.12 Use to Groovy 2.4.12 for full Java 9 compatibility Sep 22, 2017
@oehme oehme changed the title Use to Groovy 2.4.12 for full Java 9 compatibility Upgrade to Groovy 2.4.12 for full Java 9 compatibility Sep 22, 2017
@oehme oehme added this to the 4.3 RC1 milestone Sep 22, 2017
@BeneStem
Copy link

@BeneStem BeneStem commented Sep 22, 2017

Groovy 2.4.12 seems to have the same problem:

$ groovy -v
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.codehaus.groovy.reflection.CachedClass (file:/usr/local/Cellar/groovy/2.4.12/libexec/lib/groovy-2.4.12.jar) to method java.lang.Object.finalize()
WARNING: Please consider reporting this to the maintainers of org.codehaus.groovy.reflection.CachedClass
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
Groovy Version: 2.4.12 JVM: 9 Vendor: Oracle Corporation OS: Mac OS X
@blindpirate
Copy link
Member Author

@blindpirate blindpirate commented Sep 23, 2017

@BeneStem Thanks for reporting. That's just warning. Groovy uses too much reflection and Java 9 is much more restrictive concerning reflective access to non-public fields/methods. However, there's still something we can try to remove this warning.

Reference: https://blog.codefx.org/java/java-9-migration-guide/#Illegal-Access-To-Internal-APIs

@donhuvy
Copy link

@donhuvy donhuvy commented Sep 29, 2017

I am using Windows 10 x64 pro. same error

Microsoft Windows [Version 10.0.15063]
(c) 2017 Microsoft Corporation. All rights reserved.

C:\Users\vydn>gradle -v
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.codehaus.groovy.reflection.CachedClass (file:/C:/tools/gradle-4.2/lib/groovy-all-2.4.11.jar) to method java.lang.Object.finalize()
WARNING: Please consider reporting this to the maintainers of org.codehaus.groovy.reflection.CachedClass
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release

------------------------------------------------------------
Gradle 4.2
------------------------------------------------------------

Build time:   2017-09-20 14:48:23 UTC
Revision:     5ba503cc17748671c83ce35d7da1cffd6e24dfbd

Groovy:       2.4.11
Ant:          Apache Ant(TM) version 1.9.6 compiled on June 29 2015
JVM:          9 (Oracle Corporation 9+181)
OS:           Windows 10 10.0 amd64

C:\Users\vydn>javac -version
javac 9

C:\Users\vydn>java -version
java version "9"
Java(TM) SE Runtime Environment (build 9+181)
Java HotSpot(TM) 64-Bit Server VM (build 9+181, mixed mode)

C:\Users\vydn>
@blindpirate
Copy link
Member Author

@blindpirate blindpirate commented Sep 29, 2017

@donhuvy @BeneStem Thanks for reporting. Actually this warning is on Groovy side and there's not much we can do. You can add the following arguments to java bootstrap script or JAVA_OPTS to suppress this warning:

--add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.invoke=ALL-UNNAMED
@oehme oehme reopened this Sep 29, 2017
@blindpirate blindpirate assigned blindpirate and unassigned bmuschko Sep 29, 2017
@oehme oehme assigned bmuschko and unassigned blindpirate Sep 29, 2017
@oehme
Copy link
Contributor

@oehme oehme commented Sep 29, 2017

The upgrade was done: 7873630
If the full pipeline is green, this can be closed.

@bw-smarkwell
Copy link

@bw-smarkwell bw-smarkwell commented Dec 30, 2017

https://issues.apache.org/jira/browse/GROOVY-8339 is the Groovy Ticket which is tracking the issue

javabrett added a commit to javabrett/gretty that referenced this issue Feb 20, 2018
Minimum for Groovy on JDK9 is 2.4.12, ref gradle/gradle#2995 .
javabrett added a commit to javabrett/gretty that referenced this issue Feb 20, 2018
Minimum for Groovy on JDK9 is 2.4.12, ref gradle/gradle#2995 .

Progress towards JDK9 akhikhl#390.
javabrett added a commit to gretty-gradle-plugin/gretty that referenced this issue Mar 2, 2018
Minimum for Groovy on JDK9 is 2.4.12, ref gradle/gradle#2995 .

Progress towards JDK9 akhikhl#390.
henrik242 added a commit to gretty-gradle-plugin/gretty that referenced this issue Mar 3, 2018
Minimum for Groovy on JDK9 is 2.4.12, ref gradle/gradle#2995 .

Progress towards JDK9 akhikhl#390.
@dginovker
Copy link

@dginovker dginovker commented Mar 5, 2018

Still having this issue with latest version

https://i.imgur.com/92JveDx.png

@oehme
Copy link
Contributor

@oehme oehme commented Mar 6, 2018

@dginovker The issue was that the build would fail. The warnings are expected and we can do nothing about them until Groovy somehow works around the new JDK limitations (or the JDK offers a better API for Groovy to use).

@arjunmarati
Copy link

@arjunmarati arjunmarati commented Mar 21, 2018

I see the same, issue still persists.

."C:\Program Files\Java\jdk-9.0.4\bin\java" -ea -Didea.test.cyclic.buffer.size=1048576 "-javaagent:C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2017.2.7\lib\idea_rt.jar=56089:C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2017.2.7\bin" -Dfile.encoding=UTF-8 -classpath "C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2017.2.7\lib\idea_rt.jar;C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2017.2.7\plugins\testng\lib\testng-plugin.jar;C:\Users\a624204\IdeaProjects\SampleProjectName\target\test-classes;C:\Users\a624204.m2\repository\io\rest-assured\rest-assured\3.0.7\rest-assured-3.0.7.jar;C:\Users\a624204.m2\repository\org\codehaus\groovy\groovy\2.4.12\groovy-2.4.12.jar;C:\Users\a624204.m2\repository\org\codehaus\groovy\groovy-xml\2.4.12\groovy-xml-2.4.12.jar;C:\Users\a624204.m2\repository\org\apache\httpcomponents\httpclient\4.5.3\httpclient-4.5.3.jar;C:\Users\a624204.m2\repository\org\apache\httpcomponents\httpcore\4.4.6\httpcore-4.4.6.jar;C:\Users\a624204.m2\repository\commons-logging\commons-logging\1.2\commons-logging-1.2.jar;C:\Users\a624204.m2\repository\commons-codec\commons-codec\1.9\commons-codec-1.9.jar;C:\Users\a624204.m2\repository\org\apache\httpcomponents\httpmime\4.5.1\httpmime-4.5.1.jar;C:\Users\a624204.m2\repository\org\hamcrest\hamcrest-core\1.3\hamcrest-core-1.3.jar;C:\Users\a624204.m2\repository\org\hamcrest\hamcrest-library\1.3\hamcrest-library-1.3.jar;C:\Users\a624204.m2\repository\org\ccil\cowan\tagsoup\tagsoup\1.2.1\tagsoup-1.2.1.jar;C:\Users\a624204.m2\repository\io\rest-assured\json-path\3.0.7\json-path-3.0.7.jar;C:\Users\a624204.m2\repository\org\codehaus\groovy\groovy-json\2.4.12\groovy-json-2.4.12.jar;C:\Users\a624204.m2\repository\io\rest-assured\rest-assured-common\3.0.7\rest-assured-common-3.0.7.jar;C:\Users\a624204.m2\repository\io\rest-assured\xml-path\3.0.7\xml-path-3.0.7.jar;C:\Users\a624204.m2\repository\org\apache\commons\commons-lang3\3.4\commons-lang3-3.4.jar;C:\Users\a624204.m2\repository\javax\xml\bind\jaxb-api\2.2.12\jaxb-api-2.2.12.jar;C:\Users\a624204.m2\repository\org\testng\testng\6.14.2\testng-6.14.2.jar;C:\Users\a624204.m2\repository\com\beust\jcommander\1.72\jcommander-1.72.jar;C:\Users\a624204.m2\repository\org\apache-extras\beanshell\bsh\2.0b6\bsh-2.0b6.jar;C:\Users\a624204.m2\repository\com\android\tools\build\gradle\2.3.0\gradle-2.3.0.jar;C:\Users\a624204.m2\repository\com\android\tools\build\gradle-core\2.3.0\gradle-core-2.3.0.jar;C:\Users\a624204.m2\repository\com\android\tools\build\builder\2.3.0\builder-2.3.0.jar;C:\Users\a624204.m2\repository\com\android\tools\build\builder-model\2.3.0\builder-model-2.3.0.jar;C:\Users\a624204.m2\repository\com\android\tools\build\builder-test-api\2.3.0\builder-test-api-2.3.0.jar;C:\Users\a624204.m2\repository\com\android\tools\sdklib\25.3.0\sdklib-25.3.0.jar;C:\Users\a624204.m2\repository\com\android\tools\layoutlib\layoutlib-api\25.3.0\layoutlib-api-25.3.0.jar;C:\Users\a624204.m2\repository\com\intellij\annotations\12.0\annotations-12.0.jar;C:\Users\a624204.m2\repository\com\android\tools\dvlib\25.3.0\dvlib-25.3.0.jar;C:\Users\a624204.m2\repository\com\android\tools\repository\25.3.0\repository-25.3.0.jar;C:\Users\a624204.m2\repository\com\google\jimfs\jimfs\1.1\jimfs-1.1.jar;C:\Users\a624204.m2\repository\com\google\code\gson\gson\2.2.4\gson-2.2.4.jar;C:\Users\a624204.m2\repository\org\apache\commons\commons-compress\1.8.1\commons-compress-1.8.1.jar;C:\Users\a624204.m2\repository\com\android\tools\sdk-common\25.3.0\sdk-common-25.3.0.jar;C:\Users\a624204.m2\repository\com\android\tools\common\25.3.0\common-25.3.0.jar;C:\Users\a624204.m2\repository\com\android\tools\build\manifest-merger\25.3.0\manifest-merger-25.3.0.jar;C:\Users\a624204.m2\repository\net\sf\kxml\kxml2\2.3.0\kxml2-2.3.0.jar;C:\Users\a624204.m2\repository\com\android\tools\ddms\ddmlib\25.3.0\ddmlib-25.3.0.jar;C:\Users\a624204.m2\repository\com\android\tools\jack\jack-api\0.13.0\jack-api-0.13.0.jar;C:\Users\a624204.m2\repository\com\android\tools\jill\jill-api\0.10.0\jill-api-0.10.0.jar;C:\Users\a624204.m2\repository\com\android\tools\analytics-library\protos\25.3.0\protos-25.3.0.jar;C:\Users\a624204.m2\repository\com\android\tools\analytics-library\shared\25.3.0\shared-25.3.0.jar;C:\Users\a624204.m2\repository\com\android\tools\analytics-library\tracker\25.3.0\tracker-25.3.0.jar;C:\Users\a624204.m2\repository\com\squareup\javawriter\2.5.0\javawriter-2.5.0.jar;C:\Users\a624204.m2\repository\org\bouncycastle\bcpkix-jdk15on\1.48\bcpkix-jdk15on-1.48.jar;C:\Users\a624204.m2\repository\org\bouncycastle\bcprov-jdk15on\1.48\bcprov-jdk15on-1.48.jar;C:\Users\a624204.m2\repository\org\ow2\asm\asm-tree\5.0.4\asm-tree-5.0.4.jar;C:\Users\a624204.m2\repository\com\android\tools\lint\lint\25.3.0\lint-25.3.0.jar;C:\Users\a624204.m2\repository\com\android\tools\lint\lint-checks\25.3.0\lint-checks-25.3.0.jar;C:\Users\a624204.m2\repository\com\android\tools\lint\lint-api\25.3.0\lint-api-25.3.0.jar;C:\Users\a624204.m2\repository\com\android\tools\external\com-intellij\uast\162.2228.14\uast-162.2228.14.jar;C:\Users\a624204.m2\repository\com\android\tools\external\lombok\lombok-ast\0.2.3\lombok-ast-0.2.3.jar;C:\Users\a624204.m2\repository\org\ow2\asm\asm-analysis\5.0.4\asm-analysis-5.0.4.jar;C:\Users\a624204.m2\repository\org\eclipse\jdt\core\compiler\ecj\4.6.1\ecj-4.6.1.jar;C:\Users\a624204.m2\repository\com\android\tools\build\transform-api\2.0.0-deprecated-use-gradle-api\transform-api-2.0.0-deprecated-use-gradle-api.jar;C:\Users\a624204.m2\repository\com\android\tools\build\gradle-api\2.3.0\gradle-api-2.3.0.jar;C:\Users\a624204.m2\repository\com\google\guava\guava\18.0\guava-18.0.jar;C:\Users\a624204.m2\repository\com\android\databinding\compilerCommon\2.3.0\compilerCommon-2.3.0.jar;C:\Users\a624204.m2\repository\com\android\databinding\baseLibrary\2.3.0\baseLibrary-2.3.0.jar;C:\Users\a624204.m2\repository\org\antlr\antlr4\4.5.3\antlr4-4.5.3.jar;C:\Users\a624204.m2\repository\commons-io\commons-io\2.4\commons-io-2.4.jar;C:\Users\a624204.m2\repository\com\googlecode\juniversalchardet\juniversalchardet\1.0.3\juniversalchardet-1.0.3.jar;C:\Users\a624204.m2\repository\com\android\tools\annotations\24.5.0\annotations-24.5.0.jar;C:\Users\a624204.m2\repository\org\ow2\asm\asm\5.0.4\asm-5.0.4.jar;C:\Users\a624204.m2\repository\org\ow2\asm\asm-commons\5.0.4\asm-commons-5.0.4.jar;C:\Users\a624204.m2\repository\net\sf\proguard\proguard-gradle\5.3.2\proguard-gradle-5.3.2.jar;C:\Users\a624204.m2\repository\net\sf\proguard\proguard-base\5.3.2\proguard-base-5.3.2.jar;C:\Users\a624204.m2\repository\org\jacoco\org.jacoco.core\0.7.5.201505241946\org.jacoco.core-0.7.5.201505241946.jar;C:\Users\a624204.m2\repository\org\ow2\asm\asm-debug-all\5.0.1\asm-debug-all-5.0.1.jar;C:\Users\a624204.m2\repository\org\jacoco\org.jacoco.report\0.7.5.201505241946\org.jacoco.report-0.7.5.201505241946.jar;C:\Users\a624204.m2\repository\net\sf\jopt-simple\jopt-simple\4.9\jopt-simple-4.9.jar;C:\Users\a624204.m2\repository\com\google\protobuf\protobuf-java\3.0.0\protobuf-java-3.0.0.jar;C:\Users\a624204.m2\repository\org\antlr\antlr\3.5.2\antlr-3.5.2.jar;C:\Users\a624204.m2\repository\org\antlr\antlr-runtime\3.5.2\antlr-runtime-3.5.2.jar;C:\Users\a624204.m2\repository\org\antlr\ST4\4.0.8\ST4-4.0.8.jar;C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2017.2.7\plugins\testng\lib\jcommander.jar" org.testng.RemoteTestNGStarter -usedefaultlisteners false -socket56088 @w@C:\Users\a624204\AppData\Local\Temp\idea_working_dirs_testng.tmp -temp C:\Users\a624204\AppData\Local\Temp\idea_testng.tmp
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.codehaus.groovy.reflection.CachedClass (file:/C:/Users/a624204/.m2/repository/org/codehaus/groovy/groovy/2.4.12/groovy-2.4.12.jar) to method java.lang.Object.finalize()
WARNING: Please consider reporting this to the maintainers of org.codehaus.groovy.reflection.CachedClass
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release

java.net.ConnectException: Connection timed out: connect

@aplatypus
Copy link

@aplatypus aplatypus commented Mar 22, 2018

Clearly the problem is with Groovy. Is there a matrix someplace showing what versions of Groovy work with Java 10 (aka 18.03 -- Java 9 is superseded)?

With Groovy 6.4.12 and Gradle 4.4 with the JAVA_HOME pointed to Java 10 JDK

D:> groovy -version
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.codehaus.groovy.reflection.CachedClass (file:/b:/lang/groovy/v02.04/lib/groovy-2.4.12.jar) to method java.lang.Object.finalize()
WARNING: Please consider reporting this to the maintainers of org.codehaus.groovy.reflection.CachedClass
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
Groovy Version: 2.4.12 JVM: 10 Vendor: "Oracle Corporation" OS: Windows 10

D:> gradle -version
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.codehaus.groovy.reflection.CachedClass (file:/B:/tools/gradle/v04.04/lib/groovy-all-2.4.12.jar) to method java.lang.Object.finalize()
WARNING: Please consider reporting this to the maintainers of org.codehaus.groovy.reflection.CachedClass
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release

------------------------------------------------------------
Gradle 4.4
------------------------------------------------------------

Build time:   2017-12-06 09:05:06 UTC
Revision:     cf7821a6f79f8e2a598df21780e3ff7ce8db2b82

Groovy:       2.4.12
Ant:          Apache Ant(TM) version 1.9.9 compiled on February 2 2017
JVM:          10 ("Oracle Corporation" 10+46)
OS:           Windows 10 10.0 amd64

I switched back to Java 8 JDK. I guess i can build with Java 10 compiler. Just can't build any of my Groovy code. The Groovy download page confused me. There are many different versions and betas. They must be overstaffed on that project.

An interesting point though. I only changed my JAVA_HOME to point to the Java 8 JDK and I see this:

D:> gradle -version

------------------------------------------------------------
Gradle 4.4
------------------------------------------------------------

Build time:   2017-12-06 09:05:06 UTC
Revision:     cf7821a6f79f8e2a598df21780e3ff7ce8db2b82

Groovy:       2.4.12
Ant:          Apache Ant(TM) version 1.9.9 compiled on February 2 2017
JVM:          1.8.0_162 (Oracle Corporation 25.162-b12)
OS:           Windows 10 10.0 amd64


D:> groovy -version
Groovy Version: 2.4.12 JVM: 1.8.0_162 Vendor: Oracle Corporation OS: Windows 10

I guess it's a workaround until what ever is not fixed gets fixed.

@aplatypus
Copy link

@aplatypus aplatypus commented Mar 22, 2018

tried Groovy 2.4.14, which seems to be latest release version. Fails on Java 10.

D:> groovy -version
Groovy Version: 2.4.14 JVM: 1.8.0_162 Vendor: Oracle Corporation OS: Windows 10

D:> SET JAVA_HOME=b:\lang\java\jre\v10.00\x64

D:> groovy -version
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.codehaus.groovy.reflection.CachedClass (file:/b:/lang/groovy/v02.04/lib/groovy-2.4.14.jar) to method java.lang.Object.finalize()
WARNING: Please consider reporting this to the maintainers of org.codehaus.groovy.reflection.CachedClass
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
Groovy Version: 2.4.14 JVM: 10 Vendor: "Oracle Corporation" OS: Windows 10
@aplatypus
Copy link

@aplatypus aplatypus commented Mar 22, 2018

Update -- The relevant Groovy project issue is here:

I suggest we get behind it as it has a low priority, it seems. As it has been CLOSED.

@mindthump
Copy link

@mindthump mindthump commented Mar 30, 2018

2.4.15 fails on OS X with java 10:

➜ ~ groovy --version
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.codehaus.groovy.reflection.CachedClass (file:/Users/xyzzy/.sdkman/candidates/groovy/current/lib/groovy-2.4.15.jar) to method java.lang.Object.finalize()
WARNING: Please consider reporting this to the maintainers of org.codehaus.groovy.reflection.CachedClass
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
Groovy Version: 2.4.15 JVM: 10 Vendor: "Oracle Corporation" OS: Mac OS X

@chadalen
Copy link

@chadalen chadalen commented May 4, 2018

Why was this closed? This still doesn't work.

@goldparrot
Copy link

@goldparrot goldparrot commented May 5, 2018

Agree. Why is this closed?

"WARNING: Please consider reporting this to the maintainers of org.codehaus.groovy.reflection.CachedClass"

Maintainers??

$ groovy -version
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.codehaus.groovy.reflection.CachedClass (file:/..sdkman/candidates/groovy/current/lib/groovy-2.4.15.jar) to method java.lang.Object.finalize()
WARNING: Please consider reporting this to the maintainers of org.codehaus.groovy.reflection.CachedClass
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
Groovy Version: 2.4.15 JVM: 10.0.1 Vendor: "Oracle Corporation" OS: Mac OS X

@marcphilipp
Copy link
Member

@marcphilipp marcphilipp commented May 8, 2018

@aplatypus @mindthump @nshusa @goldparrot That's not an error but a warning that will eventually be resolved in Groovy for good. This issue was about making Gradle fully compatible with Java 9 and upgrading to 2.4.12 which has both been done.

@travis-a-hoffman
Copy link

@travis-a-hoffman travis-a-hoffman commented May 9, 2018

In Java 10, this is an error, not just a warning.

@oehme
Copy link
Contributor

@oehme oehme commented May 9, 2018

This issue is not about Java 10. This can only be fully resolved by a major version upgrade for Groovy, which we can only do in Gradle 5.0.

@boycce
Copy link

@boycce boycce commented Sep 10, 2018

@oehme I guess this not currently in the 5.0 nightly build, as i'm still receiving errors.

@oehme
Copy link
Contributor

@oehme oehme commented Sep 11, 2018

Groovy has not been fixed, so nothing to upgrade on our side. I'm tempted to just filter the warnings out for now, since there is nothing we or the user can do.

@ManfredKarrer ManfredKarrer mentioned this issue Sep 18, 2018
11 of 11 tasks complete
@joelhandwell
Copy link

@joelhandwell joelhandwell commented Sep 26, 2018

Got same issue with Java 11:

$ gradle -v
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.codehaus.groovy.reflection.CachedClass (file:/C:/ProgramData/chocolatey/lib/gradle/tools/gradle-4.10.2/lib/groovy-all-2.4.15.jar) to method java.lang.Object.finalize()
WARNING: Please consider reporting this to the maintainers of org.codehaus.groovy.reflection.CachedClass
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release

------------------------------------------------------------
Gradle 4.10.2
------------------------------------------------------------

Build time:   2018-09-19 18:10:15 UTC
Revision:     b4d8d5d170bb4ba516e88d7fe5647e2323d791dd

Kotlin DSL:   1.0-rc-6
Kotlin:       1.2.61
Groovy:       2.4.15
Ant:          Apache Ant(TM) version 1.9.11 compiled on March 23 2018
JVM:          11 (Oracle Corporation 11+28)
OS:           Windows 10 10.0 amd64
@brampat
Copy link

@brampat brampat commented Nov 30, 2018

Same here, hope this can be resolved soon:

gradle --version

------------------------------------------------------------
Gradle 5.0
------------------------------------------------------------

Build time:   2018-11-26 11:48:43 UTC
Revision:     7fc6e5abf2fc5fe0824aec8a0f5462664dbcd987

Kotlin DSL:   1.0.4
Kotlin:       1.3.10
Groovy:       2.5.4
Ant:          Apache Ant(TM) version 1.9.13 compiled on July 10 2018
JVM:          11.0.1 (AdoptOpenJDK 11.0.1+13)
OS:           Mac OS X 10.13.6 x86_64
@AvrahamAtia
Copy link

@AvrahamAtia AvrahamAtia commented Dec 6, 2018

@joelhandwell The same for me, on JDK 11. any solution? I have no groovy on my machine

@marcphilipp
Copy link
Member

@marcphilipp marcphilipp commented Dec 7, 2018

The warning is no longer shown when using Gradle 5.0 on Java 11.

@gradle gradle locked as resolved and limited conversation to collaborators Dec 7, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet