(This has been updated because I have read the actual account of what happened, as given by a Sun Microsystems employee.)
When Sun Microsystems created Java, no one wanted it. Eventually Netscape started supporting Java. Somewhere down the line, Microsoft decided to licence the rights to use Java in their browser as well.
Well, Microsoft startes adding their own APIs to Java, and spun off their own Java Virtual Machine. This was done mostly to get people to write MS-IE (Internet Explorer) specific code that wouldn't run in Netscape.
Eventually Netcape followed suit, and started writing their own Java APIs. Again, so that Applets written for Netscape wouldn't run in IE.
Somewhere down the line Sun was able to get Netscape to start using their JRE again.
You can have Sun's JRE force IE and Netscape 6.0+ to use it. Older versions of Netscape cannot use Sun's JRE.
There was a settlement, following a lawsuit, between Sun Microsystems and Microsoft. Technically, Microsoft's JVM is not allowed to be produced anymore, and Sun Microsystems and Microsoft are now sharing technology.