Paul Krill
Editor at Large

Kotlin 1.4 M3 release improves Java module support

news
Jul 14, 20202 mins

Milestone beta release adds module information to default standard library artifacts, allowing developers to use modules easily with the jlink tool

modular java osgi blocks building blocks architecture stack by raphael koh via unsplash
Credit: Raphael Koh

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 <a href="https://docs.oracle.com/en/java/javase/11/tools/jlink.html" rel="nofollow">jlink</a> tool, for generating a custom Java runtime image containing platform modules required for an application.

Also on InfoWorld: What is JPMS? Introducing the Java Platform Module System ]

Previously, using 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 suspendfun is annotated with @Throws, developers must specify CancellationException:class as a parameter of the @Throws annotation.
  • 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. 

Paul Krill

Paul Krill is editor at large at InfoWorld. Paul has been covering computer technology as a news and feature reporter for more than 35 years, including 30 years at InfoWorld. He has specialized in coverage of software development tools and technologies since the 1990s, and he continues to lead InfoWorld’s news coverage of software development platforms including Java and .NET and programming languages including JavaScript, TypeScript, PHP, Python, Ruby, Rust, and Go. Long trusted as a reporter who prioritizes accuracy, integrity, and the best interests of readers, Paul is sought out by technology companies and industry organizations who want to reach InfoWorld’s audience of software developers and other information technology professionals. Paul has won a “Best Technology News Coverage” award from IDG.

More from this author