1

when i run my groovy script on console, every time i get below warnings, how i can disable this comments ??

WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.codehaus.groovy.reflection.CachedClass (file:/usr/share/groovy/lib/groovy-2.4.16.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
hardik gosai
  • 328
  • 3
  • 17
  • Related: https://stackoverflow.com/questions/47935772/groovy-warning-an-illegal-reflective-access-operation-has-occurred – lepe Nov 20 '19 at 04:02

1 Answers1

1

Seems you are using java 9 or higher

To remove this warning add the following java parameter into groovy bat/shell

--illegal-access=permit

Or define environment variable

JAVA_OPTS=--illegal-access=permit

More info about this and other java parameters:

https://docs.oracle.com/javase/9/tools/java.htm#JSWOR624

BTW, one of the options - switch to java8

daggett
  • 26,404
  • 3
  • 40
  • 56