private static Method loadMethod(String className, String methodName) {
        try {
            Method method = Class.forName(className).getMethod(methodName);
            method.setAccessible(true);// according to the Java documentation, by default, a reflected object is not accessible
            return method;
        } catch (NoSuchMethodException // the method was not found
                | SecurityException // setAccessible not allowed by security policy
                | ClassNotFoundException ex) { // the direct buffer implementation was not found
            return null;
        } catch (Throwable t) {
            if (t.getClass().getName().equals("java.lang.reflect.InaccessibleObjectException")) {
                return null;// the class is in an unexported module
            } else {
                throw t;
            }
        }
    }
This class contains the reflection based way to remove DirectByteBuffers in
java, allocation is done via ByteBuffer.allocateDirect
jme3-core/src/main/java/com/jme3/util/ReflectionAllocator.java