The Oracle v. Google legal battle over the use of Java in Android keeps on going, but this week Google made a change to Android that it hopes will let the company better navigate its current legal trouble.

Google told VentureBeat that it in "Android N," the next major version of Android, it is swapping Android's Java libraries from its own Apache Harmony-based implementation to one based on Oracle's OpenJDK—yes that Oracle, the same company suing Google. OpenJDK is the "official" open source version of the Java Platform, and Oracle makes it available under the GPL with a linking exception.

Google next told the court that it had "released new versions of the Android platform that are expressly licensed by Oracle for use by Google under the free, open source license provided by Oracle as part of its OpenJDK project. Specifically, these newly released versions of Android utilize the method headers (and the associated sequence, structure, and organization of those method headers) at issue in this litigation under the open source OpenJDK license from Oracle."

Basically, Google is going to replace the code Oracle has an issue with. It will now use Oracle's own OpenJDK, which Oracle makes available to everyone, for free, under the GPL. The Oracle v. Google fight will continue for old versions of Android, but for Android N and above, it really seems like Google is in the clear. However, as Google goes on to state in the document, "any damages claim associated with the new versions expressly licensed by Oracle under OpenJDK would require a separate analysis of damages from earlier releases." Google is essentially telling Oracle that if you want to sue over this new version, the damages are going to be a lot lower—and it might take a new lawsuit.

Google's claim that it "released" this new version of Android is an interesting statement. It's referring to various commits that landed in the AOSP codebase, but as the company's PR statement said, a commercial release will only come with Android N. We'd guess that is still the better part of a year away.

Google had a follow-up conversation with VentureBeat after the initial report, and the site updated its article to say that Google is going to "use OpenJDK libraries as its foundation for the standard Java libraries" and that "the company is still making changes to OpenJDK to make it work on Android. As a result, future versions of Android will continue to contain parts of Google’s 'own implementation' just based on OpenJDK."

Besides the supposed legal benefits, the switch to OpenJDK should give Android some technical benefits as well. Android began life using Apache Harmony—an open-source, "clean room" implementation of Java—for its Java libraries. Harmony was the basis for Android's Dalvik virtual machine and its successor ART, the Android RunTime. In Android's early days, OpenJDK was just getting started and wasn't mature enough to use, so Google used Harmony. Apache retired the Harmony project in 2011, though, leaving Google to maintain a dead code base. The switch to OpenJDK won't just be a legal dodge; Google will also get a more up-to-date, superior code base to work from. Ripping out Harmony and replacing it with OpenJDK took a lot of work on Google's part, and the change could potentially affect Android's behavior in subtle ways that would require work from app developers.

Using OpenJDK also opens the door to the latest Java features such as lambdas, providing a significant quality of life improvement for Android developers. Android's Java implementation is currently based on Java 7, while OpenJDK supports the latest version, Java 8, and should be updated to support all the future versions of Java. Apache Harmony retired at Java 6.

As this post from Software Freedom Conservancy President Bradley M. Kuhn explains, the GPL linking exception lets developers like Google use OpenJDK in a proprietary project (or just with other licenses) by linking to it. Any changes you make to a GPL'd piece of software must also be open source, and normally any derivative works must also be open source.

The linking exception stops the GPL from being "virally" open—derivative works can use the GPL'd project without being subject to the GPL themselves. Any changes made to OpenJDK by Google or its partners will still have to be open source, though. Navigating the GPL isn't a new issue for Android, however. The Linux kernel, on which Android is based, is licensed under the GPL, and Blink, Google's fork of the WebKit browser engine, is also part of Android and has an LGPL license.