An illegal reflective access operation has occurred after running a groovy program

Viewed 4836

After compiling my program groovy, I got this error before the expected result. Please, how can I fix this?

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

Here is my 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}"
        }

    }
}

I was expecting this result without the error message

1 one
1 one
1 one
0 Answers
Related