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

Illegal Reflective Access Operation Warning #5864

Closed
keithrbennett opened this issue Sep 9, 2019 · 6 comments
Closed

Illegal Reflective Access Operation Warning #5864

keithrbennett opened this issue Sep 9, 2019 · 6 comments
Milestone

Comments

@keithrbennett
Copy link

keithrbennett commented Sep 9, 2019

Environment

➜  ~   rvm current
jruby-9.2.8.0
➜  ~   jruby -v
jruby 9.2.8.0 (2.5.3) 2019-08-12 a1ac7ff OpenJDK 64-Bit Server VM 11.0.1+13 on 11.0.1+13 +jit [darwin-x86_64]
➜  ~   echo $JRUBY_OPTS

➜  ~   uname -a
Darwin MacBook-Pro-KB-13.local 18.7.0 Darwin Kernel Version 18.7.0: Tue Aug 20 16:57:14 PDT 2019; root:xnu-4903.271.2~2/RELEASE_X86_64 x86_64

Erroneous Behavior

Whenever running any command that starts JRuby, the following warnings are output to the terminal:

➜  ~   jruby -e nil
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.headius.backport9.modules.Modules to method java.lang.Object.finalize()
WARNING: Please consider reporting this to the maintainers of com.headius.backport9.modules.Modules
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

I am aware that there are other similar issues (bug reports), but @headius requested that I file this issue separately.

@monkstone
Copy link
Contributor

monkstone commented Sep 11, 2019

I see the same and more when I run JRubyArt sketches with jruby-9.2.8.0

Linux tux-PC-2163 5.0.0-27-generic #28~18.04.1-Ubuntu SMP Thu Aug 22 03:00:32 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
java 12 2019-03-19
Java(TM) SE Runtime Environment (build 12+33)
Java HotSpot(TM) 64-Bit Server VM (build 12+33, mixed mode, sharing)

@headius
Copy link
Member

headius commented Sep 11, 2019

I think this is probably ok on master. Running JRuby on Java 11 I do not get these warnings.

Note that there's a bunch of work for JRuby 9.2.9 that does a better job of handling modules.

Here's my output for JRuby 9.2.8 and JRuby master on Java 11:

[] ~/projects/jruby $ rvm jruby-9.2.8.0 do ruby -e 'puts 1'
2019-09-11T18:35:46.550+07:00 [main] WARN FilenoUtil : Native subprocess control requires open access to sun.nio.ch
Pass '--add-opens java.base/sun.nio.ch=org.jruby.dist' or '=org.jruby.core' to enable.
1

[] ~/projects/jruby $ ruby -v -e 'puts 1'
jruby 9.2.9.0-SNAPSHOT (2.5.3) 2019-09-05 84a0700 OpenJDK 64-Bit Server VM 11.0.2+9 on 11.0.2+9 +jit [darwin-x86_64]
1

See also GH-5826 which will add support for aggregating these --add-opens flags in various .jruby.java_opts files.

@headius headius closed this as completed Sep 11, 2019
@headius headius added this to the JRuby 9.2.9.0 milestone Sep 11, 2019
@headius
Copy link
Member

headius commented Sep 11, 2019

Thanks for the report @keithrbennett! Looks like we might have addressed this since 9.2.8.

@nmingotti
Copy link

nmingotti commented Feb 28, 2020

In FreeBSD 12.0:

$> java --version 
openjdk 11.0.5 2019-10-15  
OpenJDK Runtime Environment (build 11.0.5+10-1) 
OpenJDK 64-Bit Server VM (build 11.0.5+10-1, mixed mode)

jruby just downloaded

$> ./jruby --version
jruby 9.2.10.0 (2.5.7) 2020-02-18 fffffff OpenJDK 64-Bit Server VM 11.0.5+10-1 on 11.0.5+10-1 +jit [freebsd-x86_64]

$> ./jirb
 => I still see that warning

@headius
Copy link
Member

headius commented Feb 28, 2020

@nmingotti Could you open a new bug please? I do not see any warning locally on Darwin. Use the following flag to get the JDK to report all such illegal accesses on your system:

$ jruby -J--illegal-access=debug -S irb

@nmingotti
Copy link

nmingotti commented Feb 29, 2020

ok, done

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

No branches or pull requests

4 participants