BT

What Impact Will OpenJDK Have on Android Development?

by Abel Avram on Jan 08, 2016 |

We distill here some of the reactions around the web regarding Google’s adoption of OpenJDK for future Android versions.

We wrote at the end of last year that Google decided to replace the Harmony implementation of the Java libraries used in Android with OpenJDK. (The details can be found here.) In spite of the announcement coming around Christmas time, Google’s decision triggered some reactions around the web, some of which we would like to summarize here.

Google’s decision to switch to OpenJDK can be traced in code back at least to February 2015 according to this Git ticket. The code commit that brought this issue under the media’s scrutiny in December includes an important license change. The new Java libraries for Android N are no longer to be licensed under Apache License 2.0 (APL), but under GNU GPL 2, and the copyright notice includes the following statement: “Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.”

Andreas Gal, former CTO at Mozilla, wrote a post emphatically entitled “Oracle Sinks Its Claws into Android,” arguing that Google has tried for a long time to use Harmony and the Apache license because one

can use and modify APL code without having to publish the changes. In other words, you can make proprietary changes and improvements. This is not possible with the GNU libc, which is under the LGPL. I am pretty sure I know why Google thought that this is important, because as part of launching Firefox OS I talked to many of the same chipset vendors and OEMs that Google works with. Silicon vendors and OEMs like to differentiate at the software level, trying to improve Android code all over the stack. Especially silicon vendors often modify library code to take advantage of their proprietary silicon, and they don’t want to share these changes with the world. It’s their competitive moat – their proprietary advantage.

Commenting on Gal’s post, Bob Ross, who describes himself as an employee of an OEM, nuanced a bit the APL vs. GPL issue:

We do make changes to libcore. The problem with open sourcing in this case would be the tremendous overhead, not the secrecy, at least for the changes I’ve been a part of.

Bradley M. Kuhn, currently President of Software Freedom Conservancy and Member of the Board of Directors of the Free Software Foundation, has a different take on how GPL might affect Android development. In a recent post, “Sun, Oracle, Android, Google and JDK Copyleft FUD,” Kuhn draws attention to the fact that OpenJDK is licensed under an “extremely weak” license, GNU plus the Classpath exception. Kuhn was involved in designing and naming the Classpath exception which was meant to avoid “infecting” the whole Java ecosystem with a copyleft protection that would force all Java programs to be free to use and redistribute. And that makes using OpenJDK not much different than Harmony from a license perspective, according to Kuhn:

So, how is incorporating Oracle's GPL-plus-Classpath-exception'd JDK different from having an Apache-licensed Java userspace? It's not that much different! Android redistributors already have strong copyleft obligations in kernel space, and, remember that Webkit is LGPL'd; there's also already weak copyleft compliance obligations floating around Android, too. So, if a redistributor is already meeting those, it's not much more work to meet the even weaker requirements now added to the incorporated JDK code.

But Gal considers that Oracle now has an important influence regarding the future of Android not just because of the license but through the Java roadmap, trademarks, agreements, patents:

Because Oracle has means to control Java beyond source code, OpenJDK is about as open as a prison. You can vote on how high the walls are, and you can even help build the walls, but if you are ever forced to walk into it, Oracle alone will decided when and whether you can leave. Oracle owns much of the roadmap of OpenJDK, and via compatibility requirements, trademarks, existing agreements, and API copyright lawsuits (Oracle vs Google) Oracle is pretty much in full control where OpenJDK is headed.

Several readers commented on Gal’s post saying that if Oracle does not play nice with OpenJDK, nothing stops Google to fork it, and directing the development the way they want.

Gal also predicts a “rough year ahead” for Android:

All this code and technology churn will have massive implications for Android at a tactical level. Literally millions of lines of code are changing, and the new OpenJDK implementation will often have subtly different correctness or performance behavior than the Harmony code Google used previously. Here you can see Google updating a test for a specific boundary condition in date handling. Harmony had a different behavior than Oracle’s OpenJDK, and the test had to be fixed.

The app ecosystem runs on top of these shifting sands. The Android app store has millions of apps that rely on the Java standard classes, and just as tests have to be fixed, apps will randomly break due to the subtle changes the OpenJDK transition brings….

I also have a very hard time imagining Android N coming out on time with this magnitude of change happening behind the scenes. Google is changing engines mid-flight. The top priority will be to not crash. They won’t have much time to worry about arriving on schedule.

Brendan Eich supported Gal’s opinion in a tweet: “We don't know enough yet, but I agree with @andreasgal that code changes show cost+risk go up.”

Shai Almog, cofounder of Codename One, agreed that indeed there is some work ahead for Google and Android developers, but not nearly as much as Gal and Eich suggest, and there are some benefits coming from using OpenJDK:

While there are some changes that benefit users directly, most software development changes don't. Not all developers benefit from every language/API feature either.

Users will benefit from the fact that code bases are unified and security auditing will now focus on a more uniform code base. A lot of the standard Java tools might work better with Android as a result….

Yes this will take Google some effort. Yes a few apps might be affected, I'd wager this would be far less than those affected by the Marshmallow changes and Google has the tools to alleviate a lot of that problems (sdk version hints).

Some have wondered if Google’s adoption of the OpenJDK has something to do with the lawsuit they have with Oracle. Kuhn believes that behind Google’s decision are technical reasons:

A Java industry analyst (with more than a decade of experience in the area) told me that he believed the decision was primarily technical. Authors of userspace applications on Android (apparently) seek a newer Java language implementation and given that there was a reasonably licensed Free Software one available, Google made a technical switch to the superior codebase, as it gives API users technically what they want while also reducing maintenance burden. This seems very reasonable. While it's less shocking than what the pundits say, technical reasons probably were the primary impetus.

It is perhaps too early to fully evaluate the implications of Android using OpenJDK for future versions of the operating system. It depends much on Oracle and the ongoing lawsuit with Google. It is not yet clear if an API interface is copyrightable or not, and the law and the courts will have to clarify that. Parts of Android, both Java and C code, have been rebuilt starting from previous existing libraries and deleting the code but maintaining the interface or the header files. Is Android trouble free? It remains to be seen. Adopting the OpenJDK should alleviate some of the issues, Google now having Java license coverage and patents grants to protect Android from Oracle.

Rate this Article

Relevance
Style

Hello stranger!

You need to Register an InfoQ account or or login to post comments. But there's so much more behind being registered.

Get the most out of the InfoQ experience.

Tell us what you think

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Dart as an alternative... by Kris K

A while back I saw the Flutter System Architecture from Google. Don't remember all the details. Dart is pretty useless as Google envisioned it (as an alternative to JS). But it is a good language designed for a wrong purpose. It is close to C# - so wouldn't it be better for Google to invest into Dart (to make it more general purpose language) and make it a first class citizen on Android platform (outside of browser). While they are at it, they should look at interfacing with native code a better mechanism than JNI. I think Dart will be a better alternative to Java, without the challenges from Oracle. Granted it will take time for Java Developers to switch, but if the platform is rich enough, they would. Swift is a great example of that!

Re: Dart as an alternative... by Shai Almog

Dart doesn't have a significant following despite what has been literally many millions of dollars poured into it. Unlike JVM based languages where developers have the fallback of going back to Java or another JVM language, Dart is currently mostly at the mercy of Googles whims.

As a person who was burned repeatedly by those changing whims I doubt many developers will pick it up. There are plenty of good languages with wider adoption e.g. Kotlin, Scala etc.

This is about the lawsuit although it makes sense technically too by Shai Almog

It makes a lot of sense to unify the code bases as I mentioned in my article.

However, I doubt Google would have taken that route and relinquished some licensing leeway if it wasn't for the lawsuit. As evidence of that you can see their recent court filings.

Unfortunately at this time to an external observer it doesn't look like this is the beginning of the long awaited peace process that we are all hoping for. But I hope that this step will promote a deescalation and winding down of hostilities between Oracle/Google.

Re: This is about the lawsuit although it makes sense technically too by Cameron Purdy

For Google, their decisions around licensing seem to have been focused on taking control of something that they did not own -- a decision that they may be beginning to regret. For Oracle, their decisions around suing Google seem to have been focused on the possibility of revenue. Given these two things, one could predict the benefits to both companies of a negotiated settlement.

Re: This is about the lawsuit although it makes sense technically too by Shai Almog

I think saying that Google's approach of "taking over something that they did not own" sounds a bit like they did something wrong.

Back then Sun owned Java but proclaimed it to be "open" & a "standard". Google took over (forked) harmony, but that's standard practice in OSS and they kept the license in place.

It would be a shame and a huge regression if companies always only use only technologies they own.

Re: This is about the lawsuit although it makes sense technically too by Cameron Purdy

You are certainly welcome to your opinion.

Google did choose to use Java, which does have an open specification, but part of the license that makes it "open" requires that an implementer implement the entirety of the specification in a compatible manner. In other words, and in my understanding from what I have read (licenses, etc.), there is no such thing as "partial Java compatibility" or "partial Java implementation". Google, for a number of reasons (including both business and technical reasons) chose to ignore this. The result is that they took someone's work without respecting the licenses that the work was offered under. Whether you take something from some poor, gentle, kind, hard-working, hungry person in a third world country, or from some obnoxious Fortune 500 company (name withheld to protect the guilty), it is still wrong.

Fortunately the superior courts have thus far upheld the copyright law that is the foundation of every software licensing approach, including copy-left licenses like GPL. Also, you should not interpret my opposition to Google's misappropriation of someone's property as support in any way for Oracle's behavior; Google being wrong does not make Oracle right.

It would be a shame and a huge regression if companies always only use only technologies they own.


What a truly bizarre statement in that you would suggest that I posited otherwise. For the record, yes, I do agree with you.

I would like to see Google and Oracle working together as technical partners for the benefit of the industry and the Java platform. When I was still at Oracle, this particular avenue was closed to us by executive management due to the ongoing lawsuit, so the sooner a final decision is arrived at (somewhat regardless of the outcome), the better for the industry.

Peace,

Cameron.

Re: This is about the lawsuit although it makes sense technically too by Shai Almog

Google won the case on all counts except for copyright on API declarations which was defined (wrongly IMHO) by a lower court.

True the Java license requires compatibility but Google never entered into a licensing agreement over Java. They never used the Java sources and they never used the Java trademark or coffee cup logo in an illegal way. So effectively they didn't violate any license that they agreed to... (to my understanding the courts accepted this claim although typically IANAL but i did consult one).

They didn't even violate patents by building a VM that had a very different architecture from the JVM.

The courts effectively said that Google's "clean room" implementation *might* be liable. They reversed the original residing judges ruling by saying that API's can be copyrightable. I think API's were explained to them as "a set of books in a library"...

If you follow the history closely you will see that Google did want a licensing deal in which case they would have been 100% percent compliant but they debate and failure to reach a deal was triggered both by license requirements from Sun and disagreement over sums (Sun wanted royalties like they got from J2ME).

The big problem I mentioned above is that now a process that is core to our industry (clean room re-implementation) is now on shaky legal grounds. This effectively means no Compaq no AMD no WINE etc. Worse, every API published by the JCP such as JPA/JDO which should be implemented by 3rd parties might be on dubious legal standing if you are not a licensee.

Re: This is about the lawsuit although it makes sense technically too by Cameron Purdy

Google won the case on all counts except for copyright


Yes, this is how it currently stands. As I said, though: all of the licenses today (e.g. GPL) rely on copyright as the foundation for being able to control what someone can and/or can not do with software. If copyright does not hold, then none of the licenses in existence are enforceable. (I'm suggesting that you'd better hope that copyright holds!)

True the Java license requires compatibility but Google never entered into a licensing agreement over Java.


IANAL, but IMHO it is unlikely that you are correct. Google employees downloaded and accessed software, specifications, and source code that were protected by license, including in some cases click-through terms. Just because some Google executive didn't cross-sign a formal piece of paper doesn't mean that Google can ignore someone's licenses and copyrights.

If you follow the history closely you will see that Google did want a licensing deal in which case they would have been 100% percent compliant but they debate and failure to reach a deal was triggered both by license requirements from Sun and disagreement over sums (Sun wanted royalties like they got from J2ME).


I believe that if Sun had been willing to cede control of the Java license (which is ultimately the side-effect of how Google licensed out the Android platform), and if they were willing to forego royalties on Google's revenue stream realized from the continued use of Java in the Google Android platform, then yes, Google would have probably agreed to a license deal -- at the right price.

The problem is that when Google couldn't get a sweet deal on its own preferred terms, it decided that it didn't need to respect the rights of the property owner. We call that theft, whether or not we happen to like Google's web search or Google's Android platform or Google's g-mail or any of a number of nice and smart people that we know who work at Google. Also, the fact that Oracle can be a horrid company to deal with at times does not make theft from Oracle any less wrong.

Again, to be clear, you should not interpret my opposition to Google's misappropriation of someone's property as support in any way for Oracle's behavior; Google being wrong does not make Oracle right.

The big problem I mentioned above is that now a process that is core to our industry (clean room re-implementation) is now on shaky legal grounds. This effectively means no Compaq no AMD no WINE etc. Worse, every API published by the JCP such as JPA/JDO which should be implemented by 3rd parties might be on dubious legal standing if you are not a licensee.


I share your concern. You have stated a scenario which is entirely plausible, and it should be concerning to those who value what our industry has managed to create over the preceding decades, and the openness that was often a critical catalyst therein. I do not personally have a perfect answer that balances the rights of the property holder with the social obligations of the property holder. It is conceivable that a poorly behaving property holder could indeed impede the beneficial uses of their inventions in order to exert control or to maximize profit. (This concern indeed was the reason that the patent office was set up in the USA -- to support the disclosure of inventions so that they could be used by others under reasonable terms.)

At any rate, I know that reasonable and intelligent people can disagree as well as unreasonable and unintelligent people can, and the Internet is no preventer of the same. Most people in our industry did not approach this lawsuit with an open mind. Google certainly put their PR machine into overdrive to paint Oracle as a greedy bad-guy (which is not outside of the realm of believable, but as I have stated, does not excuse theft.) Strangely, this suit was heard by a jury in San Francisco, a city in which a majority of the people had actually rooted for the Kiwis and against the US team in the America's Cup -- apparently solely because the US team was headed by Larry Ellison. Even more ridiculously, Judge Alsup relied on his own technical knowledge instead of that of technical witnesses, based on his confidence gleaned from his personal history of having written a few lines of code sometime in the past. (Judge Ito would have been proud of this ridiculousness.) As a result, the outcome from those original proceedings was not at all surprising. When the ruling finally bubbled up to a serious court, the outcome was equally unsurprising. Copyright exists for a reason, and software is no less a protected work.

Peace,

Cameron.

Re: This is about the lawsuit although it makes sense technically too by Shai Almog

Did you read my original article on the subject?

I'm not pro-Google or anti-Oracle in fact a rallied against that mischaracterization of Oracle in my original article. I used to work for Sun (and later for Oracle) since the 90's. Today I work for a company that makes an open source Java based VM solution so I did follow the case very closely as it applies directly to us and what we need to do moving forward.

I'm all for copyrights upholding as I totally understand the rights of the copyright holder. The thing I'm for here is "clean room implementations", which I understand we all agree are important. Still I'm really happy the case is finally over and we can get on with our lives...

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

9 Discuss
General Feedback
Bugs
Advertising
Editorial
Marketing
InfoQ.com and all content copyright © 2006-2016 C4Media Inc. InfoQ.com hosted at Contegix, the best ISP we've ever worked with.
Privacy policy
BT

We notice you’re using an ad blocker

We understand why you use ad blockers. However to keep InfoQ free we need your support. InfoQ will not provide your data to third parties without individual opt-in consent. We only work with advertisers relevant to our readers. Please consider whitelisting us.