Google has won the latest round in its long-running battle with Oracle over the use of Java class library APIs in Android.

A San Francisco jury today found that Google's reuse of Java's core software interfaces in its own mobile operating system should be considered fair use – meaning Google can avoid paying royalties to Oracle.

The unanimous decision protects Google from having to pay out potentially nearly $10bn in damages. In January, Oracle revealed in court that Google has banked $31bn in sales and $22bn in profit from Android since it launched in 2008 – figures Google fought fiercely to keep secret.

Way back in 2010, Oracle sued Google for copyright infringement, accusing the search kingpin of ripping off Oracle's Java language APIs for its Android platform without paying a dime for the designs. Oracle acquired Java when it bought Sun Microsystems that year.

Last year, Oracle successfully argued in the courts that it can copyright its software interfaces – not just its software, but the way Java's core library code interfaces with applications: the function names, variables, parameters, what they do, and so on.

Oracle alleged that Google, in implementing its own Java class library, had lifted pages of library files from Oracle's copyrighted source. Much of the copied code – spread over 11,000 lines – involved identical method names, calling parameters and return data, plus common variable names.

Crucially, although Android was found to have infringed Oracle's copyrighted API design, the trial jury deadlocked on whether or not that infringement constituted fair use. That stalemate forced the brouhaha to roll into this month for another round of legal arguments before another jury. In the background to this, Google has been lining up the open-source OpenJDK Java class libraries for future Android builds so it can ditch its Apache Harmony-derived code. Who oversees OpenJDK? Why, Oracle, of course – which still wants money from earlier releases of Google's mobile OS regardless of whatever development kit it's using today.

On Thursday this week, after fewer than four days of deliberation, a jury decided, with the flick of a pen, that it is fair for Android to lift Oracle's API designs:

It means that, yes, software interfaces can be copyrighted, and yes, copying them is OK, at least in this case, for now anyway. You can read the instructions to the jury from the judge, here [PDF].

Google's friends, including the EFF, hailed the verdict as good news for programmers. They feared an Oracle win would have put many smaller developers at risk of legal action by simply reimplementing someone else's software interfaces.

"It was everyone's understanding that you are allowed to reimplement these APIs, and that is how you have seen software development and interoperability work throughout history," the EFF's Parker Higgins told the The Reg earlier.

Google wins Oracle v. Google. Big victory for fair use. — Parker Higgins (@xor) May 26, 2016

Though the decision is a win for Google, the case will not be resolved any time soon. Oracle plans to appeal the outcome and pursue another court showdown on the matter.

Minutes after the verdict was read out, a spokesperson for Google told El Reg:

Today's verdict that Android makes fair use of Java APIs represents a win for the Android ecosystem, for the Java programming community, and for software developers who rely on open and free programming languages to build innovative consumer products.

And Oracle's General Counsel Dorian Daley told us:

We strongly believe that Google developed Android by illegally copying core Java technology to rush into the mobile device market. Oracle brought this lawsuit to put a stop to Google’s illegal behavior. We believe there are numerous grounds for appeal and we plan to bring this case back to the Federal Circuit on appeal.

IDC software analyst Al Hilwa noted that "the ruling certainly sets a high bar for creativity before deserving protection from fair use."

"APIs are used pervasively in software for interoperability, and so most developers would likely prefer not to be burdened by copyrights around APIs," he sad.

"Also, when you look at the shift that is taking place towards open source you can say that the licensing of copyrights overall, in the world of developer platforms and tools, has trended towards more permissive licensing.

"Still, many companies and developers want to be free to protect their creativity in any manner they wish. I think this is a situation where Oracle feels deeply that it has been wronged and has pursued every approach possible to get remedy. I think protection through APIs was not their first choice in seeking remedy."

Nobody wants to live under a new strict IP regime. Not farmers, not programmers, not twelve random California jurors. — Dan Kaminsky (@dakami) May 26, 2016

In court, as it slowly dawned on Google's dazed lawyers that they had won, and Oracle's legal eagles were stunned into silence, Judge William Alsup thanked the jury for being "so attentive" and for their "extreme hard work" in following the rather technical case. ®