Presently I'm working in a project where I'm supposed to instrument java classes for logging purpose. I've used java.lang.instrument package and successfully instrumented all classes except those which are loaded by bootstrap loader.
As specified in the documentation, such classes can also be instrumented by using redefineClasses() api of java.lang.instrument.Instrumentation class. I've tried this api but not being able to modify the methods of preloaded classes (eg. String, Vector).
If any one has some idea of how to do it then please reply.