It was only after they went bankrupt and got bought by Oracle that things like OpenSolaris getting killed off and Java lawsuits started happening.
That is not what happened. Sun Microsystems had immense revenue and clout in the server and enterprise space because of the dotcom boom, so much so that their advertising declared "We're the dot in dotcom." Microsoft was trying to duke it out with them in the server space but Windows Server was just barely starting to become decent at that point so MS didn't get all that much traction.
When the dotcom bust hit, Sun went into a tailspin because of the glut of Sun server hardware from dead dotcoms at bargain basement prices. That eventually passed but by that time Linux + Intel was good enough to undercut both Sun and Microsoft in the server space. With no way to compete with free as in beer software, Sun was doomed.
Which is why Microsoft had to use such dirty tricks to prevent them from making inroads into workstations and desktops at the point that they still had competitive hardware.
> With no way to compete with free as in beer software, Sun was doomed.
Sun was a hardware company that did everything it could to commoditize software. That strategy works extremely well for hardware companies -- Intel successfully did the same thing for many years -- as long as their hardware is competitive.
They were perfectly content to sell SPARC hardware with Linux on it. But to do that they need to sell enough of it to keep up the R&D, i.e. they needed to ship desktop chips in similar quantities to Intel instead of only servers.
That came at a cost and the market size of people that really really wanted / needed that field toughness was considerably smaller than the general office usage market.
Whereas if not for that, you could do both. Design a solid chip and then put dozens of them in a big iron cabinet for big money but also offer desktops with just one of them for prices that compete with Dell. Except that Dell's customers expect to open their existing Office documents and run their Windows API proprietary software and then won't buy from you.
[1] https://en.wikipedia.org/wiki/United_States_v._Microsoft_Cor....
The Java stuff wasn't even the craziest part. The whole thing from investigation to the appeal took the FTC and DOJ 11 years, where they were unable to kill of Microsoft's dominance of Internet Explorer through lawfare, but it only took Mozilla and later Google six years, nearly half that time, for an open-source web browsers to have more market share than Internet Explorer.
It turns out that a better product was all that was needed. It's too bad that the Mozilla Foundation has changed course and is now adamant that Firefox be as unusable as possible.
[EDIT] I'd actually say MS losing the J# lawsuit was a net positive since it gave Hejlsberg the opportunity to create C#.
I don’t disagree on the skullduggery, but it’s worth bearing in mind that Sun, Oracle, IBM, and all the other big vendors of that period engaged in similar skullduggery. Microsoft was simply better at it, had better timing/luck, and therefore more resources and reach to play those games.
But one of those companies was always destined to become a scumbag monopoly: if it hadn’t been Microsoft, it would have been one of the others.
And the war to kick them back into line through OSS would have played out similarly, I suspect.