简体   繁体   中英

groovysh is giving invocation target exception

I recently installed groovy.

C:\Users\Shivendra Gupta>groovy -v
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.codehaus.groovy.reflection.CachedClass (file:/D:/IT%20Softwares/groovy-3.0.0-alpha-4/lib/groovy-3.0.0-alpha-4.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-4 JVM: 11.0.2 Vendor: Oracle Corporation OS: Windows 10

Now when i run the groovysh command i get the error:

在此输入图像描述

Also, when groovyConsole is behaving in strange manner :-

在此输入图像描述

I think illegal reflective access warning is may be due to compatibility issues with jdk 11. Does this means i will not be able to work with jdk 11 for groovy ?Has anyone faced similar issue? how do i resolve this ?

EDIT: I just installed java 9. I am getting exactly same error with groovysh and groovyConsole command and also getting same warning on runnung groovy -v command

这是由于JDK9 / 11与groovy之间的兼容性问题,我通过安装JDK 8解决了这个问题。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM