Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setting jvm option -Djdk.module.illegalAccess=deny #4600

Conversation

chimp1984
Copy link
Contributor

@chimp1984 chimp1984 commented Oct 6, 2020

Setting jvm option -Djdk.module.illegalAccess=deny avoids the warning logs at startup

Not sure how to add it to gradle so its set at normal compilation as well...

User get confused by the warning as it sounds somehow alerting.

WARNING: An illegal reflective access operation has occurred WARNING: Illegal reflective access by com.google.inject.internal.cglib.core.$ReflectUtils$1 (file:/Users/dev/.gradle/caches/modules-2/files-2.1/com.google.inject/guice/4.2.2/6dacbe18e5eaa7f6c9c36db33b42e7985e94ce77/guice-4.2.2.jar) to method java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain) WARNING: Please consider reporting this to the maintainers of com.google.inject.internal.cglib.core.$ReflectUtils$1 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

…ng logs at startup

Not sure how to add it to gradle so its set at normal compilation as well...

User get confused by the warning as it sounds somehow alerting.

`WARNING: An illegal reflective access operation has occurred
 WARNING: Illegal reflective access by com.google.inject.internal.cglib.core.$ReflectUtils$1 (file:/Users/dev/.gradle/caches/modules-2/files-2.1/com.google.inject/guice/4.2.2/6dacbe18e5eaa7f6c9c36db33b42e7985e94ce77/guice-4.2.2.jar) to method java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain)
 WARNING: Please consider reporting this to the maintainers of com.google.inject.internal.cglib.core.$ReflectUtils$1
 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`
@chimp1984 chimp1984 changed the title Setting jvm option -Djdk.module.illegalAccess=deny avoids the warn… Setting jvm option -Djdk.module.illegalAccess=deny Oct 6, 2020
@ripcurlx
Copy link
Contributor

ripcurlx commented Oct 6, 2020

Setting jvm option -Djdk.module.illegalAccess=deny avoids the warning logs at startup

I guess it is fine as we are not using Java 9 modules so far. It seems to be fixed in google/guice@85e30be, but not released yet.

Copy link
Contributor

@ripcurlx ripcurlx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utACK

@ripcurlx ripcurlx merged commit 36bc15d into bisq-network:master Oct 6, 2020
cd2357 added a commit to cd2357/bisq that referenced this pull request Oct 6, 2020
Backport bisq-network#4600 into this PR.

Set `-Djdk.module.illegalAccess=deny` in order to reduce warning in startup logs.
@chimp1984 chimp1984 deleted the avoid-illegal-reflective-access-operation-warning branch October 7, 2020 14:29
@cd2357
Copy link
Contributor

cd2357 commented Oct 8, 2020

FYI: this may work well with Java 10 and the current JavaFX, but it caused issues with guice in #4242 when the packaged app contains more recent JREs (tested with Java 11, 14 and 15).

More specifically, when opening the packaged app:

  • when it was packaged with this flag: starting the app just opened an empty window (with no contents whatsoever) + logs contained guice and illegal reflection exceptions
  • when it was packaged without this flag: UI worked as expected

So for now I disabled it in the new jpackage script used in #4242 with 696a788.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants