A federal appeals court granted Microsoft (NASDAQ:MSFT) a legal win late yesterday against Sun Microsystems (NASDAQ:SUNW), overturning a ruling that ordered Microsoft to include Java in its Windows operating system.

However, the court sided with Sun on another issue, upholding a ruling that requires Microsoft to abide by its earlier agreements with Sun should it choose to distribute Java.

Though both sides claimed victory, Microsoft gained the most here. In knocking down the "must carry" injunction against Microsoft, the court said that Sun didn't present enough evidence that it was terribly harmed by Microsoft's anticompetitive behavior.

The court upheld the other injunction on copyright grounds, not for antitrust reasons. An earlier court ruled that Microsoft broke a 2001 settlement with Sun, and by distributing its own version of Java, infringed on the company's copyrights. Microsoft has already stopped sending out that version of Java.

From here, the case gets sent back to U.S. District Judge J. Frederick Motz, and Sun will proceed with its private antitrust suit against Microsoft. The trial's beginning isn't likely to come until 2005, leaving plenty of time for settlement should the parties be able to reach some agreement.