Android switches to native Java 8 support
- 16 March, 2017 21:00
Android's mobile application build system will natively support Java 8 features going forward, with Google deprecating the Jack toolchain.
Jack has served as a toolchain to compile Java source code into Android dex byte code, with Java providing the basis of Android development. But now, Google wants to support Java 8 features directly in the current javax and dx set of tools.
Existing tools and plugins dependent on the Java class file format still should work, said Google Product Manager James Lau. Google plans to launch the native support as part of its Android Studio IDE in coming weeks.
Google had tested Java 8 support through Jack. "Over time, we realized the cost of switching to Jack was too high for our community when we considered the annotation processors, byte code analyzers, and rewriters impacted," saidÂ Lau. Developers can keep using Jack to build Java 8 code until the new support is available, and Lau predicted that the migration would mean little to no work.
Java 8, which fitted the language with lambda capabilities, debuted in March 2014. Android has supported lambdas and other Java 8 capabilities, including type annotations, method references, and default and static interface methods. The mobile platform also has supported Java 7 language features. Next up is Java 9, due in late July and featuring modularity and a host of other features. In his bulletin,Â Lau made no mention of the upcoming Java upgrade.
The Android build system compiles application resources and source code for packaging into Android Application Packages for testing and distribution. Android Studio uses the Gradle build toolkit to automate the build process.