kryo: Java 9 illegal reflective access warning

I’m quite sure it can be ignore for some time, but reporting it anyway:

WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.esotericsoftware.kryo.util.UnsafeUtil (file:/home/signals/green-engine-runner/scripts/admin/repo/kryo-4.0.1.jar) to constructor java.nio.DirectByteBuffer(long,int,java.lang.Object)
WARNING: Please consider reporting this to the maintainers of com.esotericsoftware.kryo.util.UnsafeUtil

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Reactions: 14
  • Comments: 22 (1 by maintainers)

Commits related to this issue

Most upvoted comments

@NathanSweet , @voidburn The switch --illegal-access=deny is JVM-wide, affecting all libraries, not just Kryo. And while it’s a good thing that Kryo will fall back to an alternate source of reflection, just about any other library that performs illegal access (there are still tons of them out there) will fail.

If you just need the warning suppressed, add the following to your JVM args --add-opens=java.base/java.nio=ALL-UNNAMED. It’s always better to be specific when suppressing a warning.

Warning aside, I’m more interested in understanding what this means for Kryo once this breaks. Is this something that has a clear upgrade path?

@Daanielvb: add-opens has to be a JVM argument and not an environment variable. Try adding it to the beginning of your VM args.

@HabeebCycle: You currently have two options:

Open up the modules as described above or disable unsafe using -Dkryo.unsafe=false.