#927056 groovy: Groovy gives warning with OpenJDK 11 about illegal reflective access

Package:
groovy
Source:
groovy
Submitter:
Egon Willighagen
Date:
2022-02-03 09:33:05 UTC
Severity:
normal
Tags:
#927056#5
Date:
2019-04-14 12:01:08 UTC
From:
To:
Dear Maintainer,

with OpenJDK 11 (which seems to be the default in Buster) Groovy gives a warning at
start up time, for any Groovy script.

$ groovy -e "foo = \"Foo\""
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

This is not the case with Java8 and may have to do with classes removed in Java11? Setting JAVA_HOME to have it use Java8 removes the warning.
The scripts do seem to run fine otherwise.

With kind regards,

Egon

#927056#18
Date:
2020-04-25 16:59:18 UTC
From:
To:
Hi,

the Groovy issue only lists 3.0.0-beta1 as "Fix Version". Has it really
been fixed in 2.4.17? Even if it was, Groovy should be updated to at
least 2.5.x, better to 3.x in testing, shouldn't it?

Bye...

    Dirk

#927056#23
Date:
2020-04-25 17:10:26 UTC
From:
To:
Hi,

did a quick check, and there's no fix for this in neither 2.4.19 not
2.5.11. So the only fixed versions are those >=3.0.0.

Bye...

    Dirk

#927056#28
Date:
2022-02-03 09:23:05 UTC
From:
To:
Hi,

Groovy 4.0.0 has been released last week. See also:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=951831

Bye...

    Dirk