Groovy JDK 11 禁用警告消息 [英] Groovy JDK 11 disable the WARNING message

查看:34
本文介绍了Groovy JDK 11 禁用警告消息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我在 JDK 11 上运行 Groovy 2.5.3 时,它给出警告消息:

When I run Groovy 2.5.3 on JDK 11 its giving 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

是否可以选择禁用此警告消息?

推荐答案

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

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
"'
hi

这篇关于Groovy JDK 11 禁用警告消息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆