title: How to hotswap code running on JVM through JNI
body: <p>I have run into a problem which I'm not even sure is solvable considering how the JVM works. I am using the JVM as a scripting engine and need to be able to reload code on the fly as is expected of any game engine. I'm not even sure how this would be possible. I have to be able to do this through the JNI as the scripting engine interacts with the main native program that runs it. Hours of searching on the Internet tells me to use custom class loaders and such which can then be garbage collected. Is there a nice way to do this with examples. Thanks.</p>