Well, you find out that the Instrumentation API exists, and it offers class overrides as an operation. So, it's time to rethink the original premise "The JVM does not really allow you to change the definition of classes already loaded."
You should notice that
- as the links show, the Instrumentation API is part of the standard API
- support for class overrides, however, is optional. You may ask if the current JVM supports this feature.
- it may be limited so as not to support each class; you may ask if this is possible for a particular class
- Even if supported, changes may be limited to include documentation :
, . , , . .
- , ; ,
, Instrumentation ..
, EJB, , ClassLoader, , .
Java <ClassLoader, Qualified Name>, ...