Kotlin 1.4 M3 release improves Java module support
The planned next release of the JetBrains-sponsored Kotlin language, version 1.4, has reached its last milestone preview stage, with a change to the standard library to better take advantage of Java modularity.
With the M3 update, standard library artifacts now include module-info descriptors, derived from Java 9’s module system. Kotlin runs on the JVM. The Kotlin 1.4 release adds
module-info.java module information to default standard library artifacts, so developers can use modules easily with the
jlink tool, for generating a custom Java runtime image containing platform modules required for an application.
jlink with the Kotlin standard library was more complicated, nor was setup straightforward. For processing jars with module-info, Android developers must make certain they use the Android Gradle 3.2 plug-in or higher.
Unveiled July 6, the Kotlin 1.4 M3 milestone release also includes these other improvements:
- Functional interfaces have been added to the standard library.
- Also in the standard library, new collection operations cover real-life cases.
- Small changes have been made to the behavior of suspended functions annotated with
@Throws. For example, if a
suspendfunis annotated with
@Throws, developers must specify
CancellationException:classas a parameter of the
- Some functions have been deprecated on floating-point arrays.
The changelog covers the complete list of changes in the M3 release. Developers can try Kotlin online via the Kotlin Playground. Developers using the IntelliJ Idea or Android Studio IDE can update their Kotlin plug-in to version 1.4-M3. This milestone follows the M2 milestone release published in June. A planned release candidate for Kotlin 1.4 will finalize the scope of the upgrade.