In retrospect, we know that Sun's "Write Once, Run Anywhere" promise was a lie, and Windows developers didn't need Java since there were so many better (and faster) development options available for Windows. Eventually, products like Adobe Flash filled the web-applet niche that Java thought it would occupy. Java isn't a failure by any means, but it's not what anyone thought it would be 15 years ago.
Java does have a large set of open-source development tools that have grown up around it such as Eclipse. Google no doubt wanted to jump-start its Android development efforts by tapping into that when it announced its development tools in 2007. Yet even back then, Google was spitting in the general direction of Sun and the Java standard. Sun only provided a royalty-free license to Java patents if the implementation conforms to standard Java, and Oracle says Google's version doesn't do that. They may have a good case.
Oracle and Google pounding it out over intellectual property could be good for Microsoft in several ways. Microsoft is already crowing to its phone OEMs that Windows Phone 7 will come with Microsoft's protection against IP issues in the software. If the lawsuit continues on for a long time and it appears Android development may be affected, developers may throttle back their efforts in anticipation of the coming changes. That could hurt the quality of Android apps, and give Windows Phone 7 a chance to catch up.
Some articles are floating another possible scenario, where Google abandons Java for the open-source implementation of Microsoft's .NET environment, called Mono. It's true that Microsoft has put fewer restrictions on .NET than Sun/Oracle puts on Java. Unlike the iPhone world, Google has no problem with anyone creating different Android development tools. Given how much effort Google has invested in Java development, however, this scenario seems unlikely.
Any industry fight where Microsoft is outside the ring is a good fight for Microsoft. That's especially true in the mobile market, where the company is having to come from far behind. The best outcome for Microsoft would be for this controversy to last at least until 2011, when Windows Phone 7 is out the door and making waves on its own merit. These legal battles seem to drag out, so there's a good chance the company will get its wish.