Groovy JDK 11 disable the WARNING message

孤街浪徒 提交于 2019-12-01 14:38:26

问题


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

Thanks


回答1:


You can disable the Java warnings with GROOVY_TURN_OFF_JAVA_WARNINGS as a temporary fix:

$ GROOVY_TURN_OFF_JAVA_WARNINGS=true groovy -e 'print "hi\n"'
hi


来源:https://stackoverflow.com/questions/52930532/groovy-jdk-11-disable-the-warning-message

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!