question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support the Java Module System

See original GitHub issue

I’m quoting directly from https://github.com/Kotlin/kotlinx.serialization/issues/940 because the same reasoning applies:

What is your use-case and why do you need this feature? As of Kotlin 1.4-M3, Java 9 module descriptors have been added to the standard library artifacts (KT-21266). It would be nice to see this also happen to libraries in the Kotlin ecosystem going forward as this would enable Kotlin JVM applications to benefit from modern JDK tools (such as jlink).

Describe the solution you’d like Ideally, an explicit descriptor would be added using the Multi-Release JAR mechanism (JEP 238) added in JDK 9 (just as it was done for the standard library).

Additionally,

  1. I’m currently working on a desktop application for which using the module system (with jlink and jpackage) is extremely handy and I would love to use kotlinx.coroutines without additional non-trivial build-system hacks.
  2. Publishing a library with an explicit module descriptor and with a dependency on kotlinx.coroutines is not possible because the latter does not have a stable module name.

A temporary (and fairly simple) solution for 2. would be providing stable Automatic-Module-Name entries.

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:20
  • Comments:24

github_iconTop GitHub Comments

5reactions
lion7commented, May 19, 2022

I opened PR https://github.com/Kotlin/kotlinx.coroutines/pull/3297 with full support for JPMS. However, there is still an open issue with highlighting in IntelliJ IDEA that is kind of annoying…

5reactions
lion7commented, Sep 7, 2021

~~I created a PR which adds a dedicated module-info: https://github.com/Kotlin/kotlinx-datetime/pull/135~~ Whoops, wrong repo / issue… Anyway, I’m working on a PR to add JPMS support to kotlinx.coroutines. The biggest challenge is probably to add JPMS support to upstream libraries / dependencies first. My progress can be found here: https://github.com/lion7/kotlinx.coroutines/

Read more comments on GitHub >

github_iconTop Results From Across the Web

Understanding Java 9 Modules - Oracle
In this article, I introduce the Java 9 Platform Module System (JPMS), the most important new software engineering technology in Java since its...
Read more >
A Guide to Java 9 Modularity - Baeldung
Learn the essentials of building and using modules in Java 9. ... known as the Java Platform Module System (JPMS), or “Modules” for...
Read more >
Java Platform Module System - Wikipedia
The Java Platform Module System specifies a distribution format for collections of Java code and associated resources. It also specifies a repository for ......
Read more >
The Java Module System - Manning Publications
The Java Module System is your in-depth guide to creating and using Java modules. With detailed examples and easy-to-understand diagrams, you'll learn the ......
Read more >
JPMS : Java Platform Module System - GeeksforGeeks
With the help of the Java module system, we can package our Java application and our Java packages into Java modules. By the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found