Google Copied Code Line-by-line?

“A woeful mischaracterization of the artful design of the Java package”

Java was created by the mighty Sun Microsystems. It could be run under licence, and so when Google created Android they used Java, but recreated their own run time environment. But, rather than getting Sun Microsystems to sign a licence agreement for this, they just went ahead and created Android. When Oracle acquired Sun Microsystems, it could see the potential of suing Google for its now licenced usage of Java. And so first they tried a patent case, and lost, but then won over a non-signing of a licencing agreement. The US Supreme Court say they are now willing to take on an appeal related to copyright case, and it will provide a landmark ruling for the rest of the software industry.

So while large tech companies such as Microsoft and IBM are backing Google, Scott McNealy — the co-founder of Sun Microsystems and one of the most respected people in the computing industry — has stepped forward with his viewpoints, and they are fairly stinging towards Google’s copying of Java for their Android platform:

“woeful mischaracterization of the artful design of the Java packages”

“an insult to the hard-working developers at Sun who made Java such a success”.

He outlines that Google virtually copied — line for line — 37 Java packages for Android.

2018 ruling

Google is currently facing a fine of $9 billion in damages for breaching the Java copyright and has taken it to the Supreme Court [here]:

For Google the fight is not just about the damages, but on the future of software development [here]:

The Child of Two Parents

Java is a like a child stuck in-between two dueling partners who want custody of it. It used to have one parent … the great and much missed Sun Microsystems, but now has two: Oracle, and Google. One of its new parents decided one day to clone the child, and make lots of them .. in fact billions of them. And that child was named Android.

In 2016, Oracle lost a fight for damages of $9 billion from Google in a breach of its APIs, but came back at Google in 2018 on IP breaches and won the case. Google now must feel that they should have created their own operating system for Android, and this avoided the issues with Oracle. When they started developing with Android, they were dealing with Sun Microsystems, and should have gained a licence from them. By Sun Microsystems were a very different company to Oracle, who acquired the company, and its olden egg (Java).

And so Java became the most successful programming language and now one of the most popular operating systems. But the other partner, who thought that they owned the child, has decided to sue and get the child back. Java is still top for job postings, but Python is chasing fast. C++ and C# seem fairly stable:

But Java has failed in certain areas, including its integration into browsers, but the integration into Android gave it a new place to thrive, alongside its home at the back-end of many corporate systems.

2016 ruling

Java was created in 1995 by Sun Microsystems, but in its short life it has been causing a bit of trouble and which could have shaken software development to its core. In 2016, Google won its case against Oracle, and when it dodged over $9 billion is remediation costs. The case related to Google building their own run time engine for Java for the Android operation system, and thus replicate the key API calls made to the Java core.

The ruling meant that open source developers needed to take care around the ruling as Google’s success related to the openness of its APIs, which meant the licencing of them could be ignored. This could mean that open source software could be seen in the same way, and could easily be copied, with little regard for GPL (general public license). This would mean that companies would not have to be a royalty if they licenced the open source versions of the software. The ruling also makes it unlikely that developers can actually copyright their software. This move is thus likely to move developers into the Cloud, and licence services rather than software.

2018 ruling

Google’s luck ran out in March 2016, when the US Court of Appeals ruled in favour of Oracle [here]:

Google lost the $9bn ‘fair use’ court appeal. The main thing that Google failed to get from Sun Microsystems was a licence, and this was before it was acquired by Oracle. This overruled the 2016 fair API ruling, which had fallen under copyright, rather than IP (Intellectual Property) rights. Considering that Oracle bought Sun Microsystems for just over $7 billion, and will receive around $9 billion from the ruling, it looks like the deal was the bargain of the century.

Potted history

The Java programming language and its run-time environment were created so that developers could write code that would run on any device and which used a standardized RTE (Run-time environment) which converts the run time code into a form which can run on the machine.

Java, though, has had a potted history, especially from some major security flaws and with its lack of adoption as a browser plug-in. It has, though, won through on enterprise systems, and had a major victory with the adoption by Google on its Android operating system. Three recent security vulnerabilities, which were fixed with updates last month, were rated as 10-out-of-10 for the impact.

The current problem is around the Android version of Java, especially in relation to API (Application Program Interface) calls. With these the developer makes use of a set of standard code interfaces, such as for cryptography, graphics and disk access, to integrate into their program. The developer thus uses the standardized API, and does not have to write their own code. APIs thus make it convenient to call well tested code and which performs standard functions.

Google re-engineered their operating system so that Java developers could bring their code to Android, as they supported all the standard API calls that Oracle has created for their JRE, and this is what has caused the problem. So the fundamental questions is whether an API interface be copyrighted. For example, if I created an API call named BillCrypto(), can I copyright it that so that no-one else can mimic my call? This would then create a lock-in for the code, in that no-else could come along and create a similar BillCrypto() call, as it would breach my copyright.

At the core of the argument is whether companies can lock their code to their API calls, and whether the Android system breaches copyright. So, in May 2012, a court in the US found that APIs weren’t copyrightable, and that Google did not infringe Oracle’s patent. Since then, though, on 9 May 2014, the Federal Circuit reversed part of the ruling in favour of Oracle, especially related to the copyright issue around APIs.

Along with the breaching of copyright on the Java APIs, Oracle have also filed for breaches of two patents:

  • 6061520. Method and system for performing static initialization.
  • RE38104. Method and apparatus for resolving data references in generated code.

Oracle owns the APIs?

At the core of the debate is now whether companies can own their API calls. After the recent cases, the Supreme Court approach the Obama Administration on the Federal Circuit verdict, and, on Tuesday, they announced that they are siding with Oracle. Shares in Oracle immediately rose by a couple of percentage points on the verdict. The Justice Department has since stated its case that it does not want the Supreme Court to hear the case.

For most in the industry, the ruling of copyrighting APIs would be a disaster, and would mean that many companies would have to pay extensive licence fees on code, and even have to write their own APIs, even for the simplest of things

In the initial trial, District Judge William Alsup even taught himself Java to learn the foundation of the language, and he and he decided that copyrighting Java APIs would allow it to become too broad, and cover a whole range of common items like Window menus and interface controls. The Obama Administration’s has since went against this and has sided with the Federal Circuit verdict, and highlight that the case should be decided on whether Google had a “fair use” right to use the APIs that were developed with Oracle’s version of Java.

History of Java

The history of Java goes back 20 years, when the industry was controlled by Microsoft, and especially on the IBM PC (with its horrible x86 architecture). Code was thus developed to run directly on the hardware and could not run on other types of systems. Others could see, such as in 1983 with Sony’s MSX system, that there was the potential to standardize the code that ran on PCs (Figure 3). For many in the computer industry, the lock-in of software and had benefits of controlling the market, where the hardware that was most popular, resulted in the most software being written. Thus games written on the ZX Spectrum could not run on the Commodore 64, and so it continued until Java came along.

Figure 3: Sony’s MSX system

Java’s officially date of birth is 23 May 1995 with Java 1.0a2, and was announced at the SunWorld conference in San Francisco. The leading browser at the time, Netscape, was one of the first to adopt the technology. It was developed through Sun Microsystem’s “Green Project” and which involved Patrick Naughton, Mike Sheridan and James Gosling. It was Gosling who created a software language named Oak, and which was processor-independent. Unfortunately Oak was an existing trademark, so Sun Microsystems quickly changed its name to Java, and in 1994 they had developed a whole browser — which was to become Mosaic — but named WebRunner and also HotJava — using Java (Figure 4). With Netscape adopting it, it became an instant success after its release.

Figure 4: Sun Microsystems HotJava(tm)

In software development we have two main types of environments in which code can run: natively within a managed run-time environment. With native code a compiler converts the high-level programming language into the actual machine code required to run on the actual hardware used. This is fast when running, but runs directly on the machine so can cause problems in hogging the resources of the machine. It also cannot be run on other computer types, so that a Windows program cannot run on a mobile phone, as they are using different processors and have a different operation for the hardware.

Java thus addressed this with a managed run-time environment, which took the machine-like code and converted it into the code required to run on the actual hardware used. This environment could thus watch what the code was doing, and not allow it to do bad things on the machine. Microsoft saw Java is a massive threat, in that users could easily move programs written for Microsoft Windows onto other computer platforms, and thus came up with their equivalent: .NET.

More details on Java and from its 20th birthday here.

It’s like the PC all over again

The last time something major like this happened was with the IBM PC. At the core of the PC was the BIOS chip, and which contained the software which allowed the computer to be a PC. Many companies basically copied the BIOS code, but these were quickly dealt with as breached IBM’s copyright on the code. One company .. Compaq .. decided to complete re-write BIOS, and create their own, and which was compatible. After this, the term “IBM PC compatible” become a standard part of of the specification for a computer, where a program written for an IBM PC could run on one which was compatible. IBM’s monopoly on the PC was crushed, and the term “Compaq compatible” became just as popular as the IBM version.

Compaq went on to become one of the most successful companies in the computer industry, but others just went ahead and did want they had done, and sold less expensive computers. As it struggled in the market with so many cheaper clones, Compaq went after Digital (DEC), who were 2nd place in the computer market to IBM, before the PC, and who were one of the companies which they had managed to crush. Since then Compaq were taken over by HP.

If you’re interested, this is what a portable computer used to look like:


Java is now pulling its weight. It managed, through the work of Sun Microsystems, to become one of the most popular programming languages in the World. The keys to its success were its openness, and its ability to run on many different systems. But now there’s a trap at the end, and it could have a massive impact on the industry, where even using a button on a Window could involve copyright issues, and involve licence fees. For software developers, it will be a worrying time.

For Google, they knew they had to give developers an environment for porting existing code, and get Android up-and-running in an easy way. Overall the choice of Java has worked so well for them, and their solution was to basically provide the hooks that would normally be contained in Oracle’s version of the Java run time environment. This, though, broke the model of having one company looking after the environment, and licencing it. So even though it was open source, the API hooks were the key to being able to copy it.

So if a program wanted to change the colour of a button, it calls an API, and tells it the button and the colour. To re-write everything that related to these APIs would be a disaster for the industry, and be one of the most costly rulings ever in the software world. Developers, too, have grown up with APIs, and they allow the fast develop of robust code. For them, if they were to be copyrighted, it would lock-in so many companies into complex licencing and copyright issues.

Professor of Cryptography. Serial innovator. Believer in fairness, justice & freedom. EU Citizen. Auld Reekie native. Old World Breaker. New World Creator.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store