Groovy-警告:发生了非法的反射访问操作 [英] Groovy - WARNING: An illegal reflective access operation has occurred

查看:170
本文介绍了Groovy-警告:发生了非法的反射访问操作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对于Java和groovy,我几乎是新手.我已在Windows 10笔记本电脑(64位)上安装了groovy 3.0,并在尝试运行groovy时收到以下警告:

I am pretty much new to java and groovy. I have installed groovy 3.0 on my windows 10 laptop (64 bit) and when tried to run groovy getting following warning:

>groovy -v
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.codehaus.groovy.reflection.CachedClass (file:/C:/groovy-3.0.0-alpha-1/lib/groovy-3.0.0-alpha-1.jar) to method java.lang.Object.finalize()
WARNING: Please consider reporting this to the maintainers of org.codehaus.groovy.reflection.CachedClass
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 Version: 3.0.0-alpha-1 JVM: 9.0.1 Vendor: Oracle Corporation OS: Windows 10

而Java版本是:

java --version
java 9.0.1
Java(TM) SE Runtime Environment (build 9.0.1+11)
Java HotSpot(TM) 64-Bit Server VM (build 9.0.1+11, mixed mode)

任何帮助解决此问题的方法.

Any help to resolve this.

推荐答案

对我来说,这不仅仅是一个警告":我无法让Groovy脚本在当前JVM 9上(在m​​acOS上)运行(更不用说10)了.解决方法(直到有可用的Groovy兼容版本)是安装jenv和Java的早期版本,因此您可以在需要时进行切换.

It is more than a 'warning' for me: I cannot get Groovy scripts to run (on macOS) with the current JVM 9, much less 10. The workaround (until a compatible version of Groovy is available) is to install jenv and an earlier version of Java, so you can switch when needed.

这篇关于Groovy-警告:发生了非法的反射访问操作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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