Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-8339

Fix warning "An illegal reflective access operation has occurred"

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.4.11, 2.4.15
    • 3.0.0-beta-1
    • groovy-jdk

    Description

      I'm running JDK-9 on Windows 10 with Gradle 4.2.

      My global gradle.properties file contains the following line:
      org.gradle.java.home=C:/Program Files/Java/jdk-9

      When I request the gradle version (gradle --version) I get the following warning:

      WARNING: An illegal reflective access operation has occurred
      WARNING: Illegal reflective access by org.codehaus.groovy.reflection.CachedClass (file:/C:/Program%20Files/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
      

      This warning displayed regardless of whether I'm using a regular command prompt or an elevated rights (Administrator) command prompt.

      Here's the full command and output:

      gradle --version
      WARNING: An illegal reflective access operation has occurred
      WARNING: Illegal reflective access by org.codehaus.groovy.reflection.CachedClass (file:/C:/Program%20Files/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
      
      

      Attachments

        Issue Links

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            daniel_sun Daniel Sun
            benrobot Benjamin Roedell
            Votes:
            39 Vote for this issue
            Watchers:
            39 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0h
                0h
                Logged:
                Time Spent - 6h
                6h

                Slack

                  Issue deployment