Groovy JDK 11 disable the WARNING message

sfg*_*ups 17 groovy java-11

When I run groovy 2.5.3 on JDK 11 its giving warning message. Is there an option to disable this warning message?

groovy -e 'print "hi"'
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.codehaus.groovy.vmplugin.v7.Java7$1 (file:/home/user/.sdkman/candidates/groovy/current/lib/groovy-2.5.3.jar) to constructor 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
Run Code Online (Sandbox Code Playgroud)

Thanks

kba*_*kba 2

您可以禁用 Java 警告作为GROOVY_TURN_OFF_JAVA_WARNINGS临时修复:

$ GROOVY_TURN_OFF_JAVA_WARNINGS=true groovy -e 'print "hi\n"'
hi
Run Code Online (Sandbox Code Playgroud)