JUST WHEN MICROSOFT might have thought itself free of legal shackles, having settled antitrust charges with the Justice Department and beaten back state attorneys general seeking tougher penalties, the software giant once again finds itself with a big problem in court. This time the problem arises from an antitrust suit brought by one of its fierce competitors, Sun Microsystems. Last week a federal judge in Baltimore announced that Microsoft would have to include with its Windows operating system and Web browser a product made by Sun. The product, a programming system known as Java, is designed to permit computers using different operating systems to run applications based on the Web. It is also the main competitor to Microsoft's own nascent system, known as .Net, which the company means to promote in its usual fashion: by incorporation into Windows. The decision by U.S. District Judge J. Frederick Motz to force the company also to make that distribution channel available to Sun may seem a heavy-handed judicial regulation, but it is not. On closer inspection, it is a prudent intervention to protect a still-viable market before Microsoft squelches the competition.

It isn't news that Microsoft conducted a nasty war against Java, which it feared as a platform for software development independent of Windows. Some of the allegations of anticompetitive behavior toward Sun were part of the landmark antitrust findings against the company in the famous case brought by the government. Microsoft adopted a strategy, as one internal document put it, of "wrest[ing] control of Java away from Sun." Toward that end, it aggressively interfered with Java's distribution and actually distributed Windows with an altered version of Java incompatible with Sun's own software. The point, as another document said, was to "kill cross-platform Java by grow[ing] the polluted Java market" -- a market that depended on Windows.

The result was not, in fact, to kill Java -- as Microsoft's anticompetitive behavior killed Netscape -- in part because Microsoft did not offer a real alternative. But its activity did hamper Java's development significantly. And now Microsoft does have a system in .Net that will challenge Java head-to-head. So with Sun suing Microsoft over its past misbehavior, the question is whether history will be allowed to repeat itself, or whether Java warrants some preemptive protection.

Sun argued that unless Microsoft is made to carry Java -- unadulterated Java, that is -- alongside .Net, Microsoft's product will have an overwhelming advantage, one born largely of the company's misconduct. Given how long litigation of this type can take, Java could be dead by the time Sun's claims get vindicated -- precisely what happened with Netscape. Judge Motz agreed. The burden for Microsoft in competing on a level playing field is far less, he ruled, than the irreparable harm Sun will suffer if the market tips decisively against it in the meantime. Nor was the judge deterred by the fact that Judge Colleen Kollar-Kotelly, who heard the government's antitrust case, declined to include such a "must-carry" order as part of her remedy. The context, he ruled, is quite different. Here, the issue is whether Microsoft should reap a windfall from "a private wrong" at Sun's expense.

Erring on the side of protecting competition seems only reasonable. Judge Motz's injunction can always be lifted if it proves unnecessary or overly intrusive. But if Microsoft takes over this software market, there will be no going back.