Android goes OpenJDK

“Java 8 will be introduced to Android by changing to OpenJDK”

JAXenter Editorial Team
Operator and correspondent image via Shutterstock

Google has announced its intention to use OpenJDK instead of the Apache Harmony implementation of Java Libraries in future Android versions. This came as a surprise to many developers and brought up lots of questions. We talked to Android expert Christian Meder about the consequences of Google’s decision for deveoplers.

JAXenter: As Google announced in late 2015, Android N will be based on OpenJDK. Would you explain to us what this decision encompasses?  

Christian Meder: Most developers know of course that Android apps are usually written in Java. However, what the Java runtime on Android looks like for these apps is less known: On one hand, there is the Android Runtime (ART), or Dalvik VM with older releases, on the other hand you have implementations of many Standard-Java-APIs. The Apache Harmony Project, being the foundation of Android’s API implementation, aimed to offer a clean room implementation of Standard-Java-APIs under Apache licence. However, work on this project ended back in 2011. The implementation of standard Java APIs will now be replaced by the GPL-licensed implementation of OpenJDK in Android N.

JAXenter: What will this look like? Google will need to rewrite code, but to what extent? Some people are afraid that refactoring might be more important in the development of Android N than new features. 

Christian Meder: Most likely changes to the Android platform will be necessary only to a very small extent. The crucial point is: One implementation of Java-API will just be replaced by another. The API Library itself remains untouched. These modifications should not interfere with the introduction of new features. Rumour has it that for example multi-window-support might show up in Android N.

See also: Android places bets on OpenJDK

JAXenter: Let’s talk about the technological consequences. Will app developers have any issues to address?

Christian Meder: Developers should expect solely positive impacts from this transition. Existing Java code will work as good as with Marshmallow, while Java 8 language features like Lambdas will (finally) be available for use in Android apps. Android’s current Java implementation is based on Java 7, but Java 8 will be introduced to Android by changing to OpenJDK.

JAXenter: The license seems to be one of the main differences between Apache Harmony and OpenJDK: Apache versus LGPL. What does the change in license mean for Android?

Christian Meder: Until now, changes to the Java Standard Library implementation were possible without publishing them in source code. Proprietary changes were covered by the licence. From Android N on, that is not allowed anymore. But manufacturers are already accustomed to working with GPL code since it is also used in Linux Kernel, so changing licenses in Android should not be a serious issue to anyone. I haven’t heard about any kind of firestorm of protest from manufacturers yet.

JAXenter: In your opinion, is Google changing the implementation due to their conflict with Oracle regarding copyright matters? Or are the reasons purely of technical nature?

Christian Meder: Both of the above. In the future, Android will obtain a Java-Standard-Library in full agreement with Oracle’s Copyright – based on the OpenJDK implementation under GPL licence plus Calsspath Exception. Of course this will help Google in the lawsuite with Oracle.

Oracle’s latest reasoning has been that it holds all rights on the Standard Java API and no implementation of it is possible without touching their copyright. This reasoning becomes questionable when both, the API and the implementation comes from Oracles OpenJDK project and are used correctly according to the GPL conditions + Classpath Exception.

However, one should not forget that work on Apache Harmony-based library has been fully in Google’s hands since the project ended. Because of this, every change made to OpenJDK had to be added to the implementation in Android by hand by Google. This resulted in Android falling behind OpenJDK, still not supporting Java 8. By focussing on OpenJDK, forces can be united, Java 8 language features will be available in Android soon and further developments in Java can be added to Android faster. From a technical point of view, changing to OpenJDK is the right thing to do.

Inline Feedbacks
View all comments