| Alright a bit of googling done, also found your issue on the classfilewriter, thanks for creating it right away! The actual cause is calling setAccessible on anything in internal modules which you are not supposed to touch. Since ClassLoader#defineClass is protected, you need to invoke it and it will blow up. The only solution we know of now, is to instead use sun.misc.Unsafe which has the same method. For some reason, JDK 9 ALLOWS to call setAccessible on stuff in Unsafe, which makes it a viable workaround. However, that does not change the fact, that using Unsafe is not really nice :-/ See the links below for detailed explanation: Similar problem described here (cglib) - https://github.com/cglib/cglib/issues/93 Commit resolving this issue in JDK 9 - https://github.com/cglib/cglib/commit/d6fe1d8c73508ef30883eb1f9ae965d15953e7d0 |