VmWare and virtual servers
Following Joel's latest posting, I saw a recent article suggesting that Microsoft's acquisition of Connectix might be because they have very similar ideas in mind - virtualise servers.
IBM has been offering this capability for years in their high-end AS/400 mainframe products. Currently on an AS/400, you can load and run multiple Linux servers at the same time, assigning each one a different ip and hostname, so that you can have a virtual cluster. In environments where 99.999% uptime is a necessity (bank transactions, stock market, air traffic control) this kind of virtualization is commonplace.
How do you take out a java class and replace it with another while a JVM is running?
You need to write a specific class loader. Many java application server implementation have this feature. Ex: Tomcat, jBoss, ...
If you want the implementation details, look at these projects. They are open-source
Fog Creek Home