title: An illegal reflective access operation has occurred after running a groovy program
body: <p>After compiling my program groovy, I got this error before the expected result. Please, how can I fix this?</p>
  
  <pre><code>WARNING: An illegal reflective access operation has occurred
  WARNING: Illegal reflective access by org.codehaus.groovy.vmplugin.v7.Java7$1 (file:/Users/xxxx/.sdkman/candidates/groovy/current/lib/groovy-2.5.8.jar) to construc
  tor java.lang.invoke.MethodHandles$Lookup(java.lang.Class,int)
  WARNING: Please consider reporting this to the maintainers of org.codehaus.groovy.vmplugin.v7.Java7$1
  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
  </code></pre>
  
  <p>Here is my code</p>
  
  <pre><code>public class Todo {
      String name
      String note
  
      public static void main(String[] args) {
  
          def todos = [
              new Todo(name:"1", note:"one"),
              new Todo(name:"1", note:"one"),
              new Todo(name:"1", note:"one")
          ]
  
          todos.each {
              println "${it.name} ${it.note}"
          }
  
      }
  }
  </code></pre>
  
  <p>I was expecting this result without the error message</p>
  
  <pre><code>1 one
  1 one
  1 one
  </code></pre>