Illegal reflective access operation

Bug #1803855 reported by Danial Behzadi
22
This bug affects 4 people
Affects Status Importance Assigned to Milestone
gradle (Ubuntu)
Fix Committed
Undecided
Unassigned

Bug Description

It seems gradle can not work along with openjdk-11 in cosmic:

    WARNING: An illegal reflective access operation has occurred
    WARNING: Illegal reflective access by org.codehaus.groovy.reflection.CachedClass (file:/usr/share/java/groovy-all.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

ProblemType: Bug
DistroRelease: Ubuntu 18.10
Package: gradle 4.4.1-1
ProcVersionSignature: Ubuntu 4.18.0-10.11-generic 4.18.12
Uname: Linux 4.18.0-10-generic x86_64
ApportVersion: 2.20.10-0ubuntu13
Architecture: amd64
CurrentDesktop: ubuntu:GNOME
Date: Sun Nov 18 11:59:32 2018
InstallationDate: Installed on 2018-04-15 (216 days ago)
InstallationMedia: Ubuntu 18.04 LTS "Bionic Beaver" - Alpha amd64 (20180414)
PackageArchitecture: all
SourcePackage: gradle
UpgradeStatus: Upgraded to cosmic on 2018-10-20 (28 days ago)

Revision history for this message
Danial Behzadi (dani.behzi) wrote :
Revision history for this message
Danial Behzadi (dani.behzi) wrote :

Workaround for those who find here by search:
* remove `openjdk-11-jre-headless` and `gradle` package from repo and install `gradle` via PPA: https://launchpad.net/~cwchien/+archive/ubuntu/gradle which works with openjdk-8

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in gradle (Ubuntu):
status: New → Confirmed
Revision history for this message
Goonie (goonie) wrote :

Now that Gradle 4.4.1 is coming to Ubuntu 18.04 LTS, this bug is getting much more relevant as it isn't fixed yet.

Luckily after installing the proposed updates, I was able to revert to Java8 by using

sudo update-java-alternatives -s java-1.8.0-openjdk-amd64

and the WARNING message spamming goes away.

Revision history for this message
Matthias Klose (doko) wrote :

The problem with the PPA mentioned in #2 is that it contains prebuilt jar files which we cannot ship in the main or universe components (has to be built from source). So yes, an updated gradle built from source would be appreciated.

The bug says "gradle can not work along with openjdk-11" although others just complain about the additional warning messages.

Does it make a difference starting java for gradle with --illegal-access=permit?

Revision history for this message
Andreas Schildbach (schildbach) wrote :

I investigated into upstream bugtrackers and apparently it's a Groovy issue:

https://issues.apache.org/jira/browse/GROOVY-8339

I'm afraid I could not find out how to "starting java for gradle with --illegal-access=permit". Gradle itself doesn't take any jvm parameters.

I think at the moment the easiest way to work around this error is allowing the Ubuntu version of Gradle to work with OpenJDK 8.

RAMA SHANKAR (zipbaddi)
Changed in gradle (Ubuntu):
status: Confirmed → Fix Committed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.