The user reports JDK 11. I think the issue is almost certainly going to have to do with the module path. With the module path in play, Unsafe is now located in two modules. It's in the jdk.unsupported module, which clearly the user must not be reading in this case, and in the jdk.base module but with a new package name (jdk.internal.misc.Unsafe). My guess is that the user is running (perhaps unknowingly) with the module path in play but without explicitly doing anything to read the jdk.unsupported module. Boom: NoClassDefFoundError. In any event, Unsafe is now officially 100% a Mess™ so if there's some way to avoid using it that may be best for the long term. |