1 of 1 people found this helpful
But is it possible to inject code to class files permanently? I would like to inject some code to Java compiled class file and save changed file it in another location. How can I do that?
Sorry, I am afraid you cannot do that with Byteman. The changes it makes only work in the current JVM.
I don't know of any other tools that make it easy to do what you are asking unless you understand a lot about Java bytecode. Perhaps ByteBuddy will work? I don't really know it very well so I cannot say for certain. Otherwise you will need to look at bytecode rewriting tools like ASM or Javassist.