Generally such a thing. I need to connect to a completely left JVM process and replace at least the bodies of the f-th one of its classes. The wonderful f-Ia of many IDE "Hot Swap" immediately comes to mind. I tried to search Google for documentation about this, but it’s not strange how the tops were occupied with articles about using Hot Swap, and not about its implementation. Poke, please, nose where you want to look.

PS I was able to connect JDI, but I didn’t find something necessary there.

  • Look in the direction of the Debug API, if there is one. - VladD
  • None of the JVM implementations I know supports hot swap. The most perfect solution to date is JRebel. Essentially a crutch. It is simply an agent that keeps track of the timestamps of class files, loads newer ones and tries to re-create instances of this class while preserving their state. Even as a means of facilitating the development of JRebel has significant drawbacks, it is impossible to use it or similar solutions in any way. - Sergey Gornostaev

0