You can also serialize your state (store it in memory) and then create a new instance of ClassLoader, pointing to the new .jar files. Then serialize your state again with this new classloader. You have just changed .jars subwords in an executable product.
Note that you do not need to change the class loader for everything just for the part that actually uses .jar files. It can be difficult to figure out which parts. And if you make a mistake, you can get nasty links to errors. So..
.. to make it simple, use WebStart or a preloader that updates .jars and then launches the main application (basically what WebStart does for you).
The reason for your own is that you can use your own format for .jars, encryption, other packaging formats, etc.
Unixshadow
source share