Injecting the static initializer into the class file seems to work, but the generated classfile cannot be loaded into the JVM, see [javassist#481](https://github.com/jboss-javassist/javassist/issues/481).