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.

Add modulepath support for Java >= 9

See original GitHub issue

Ktor application can’t be compiled with JDK >=9. I’m getting a lot of such errors:

error: module kotlinx.io.jvm reads package io.ktor.http from both ktor.server.core and ktor.http.jvm
error: module kotlinx.io.jvm reads package io.ktor.http.content from both ktor.server.core and ktor.http.jvm
error: module kotlinx.io.jvm reads package io.ktor.util from both ktor.server.core and ktor.utils.jvm
error: module kotlinx.coroutines.jdk8 reads package io.ktor.http from both ktor.server.core and ktor.http.jvm
error: module kotlinx.coroutines.jdk8 reads package io.ktor.http.content from both ktor.server.core and ktor.http.jvm
error: module kotlinx.coroutines.jdk8 reads package io.ktor.util from both ktor.server.core and ktor.utils.jvm
error: module kotlinx.coroutines.core reads package io.ktor.http from both ktor.server.core and ktor.http.jvm
error: module kotlinx.coroutines.core reads package io.ktor.http.content from both ktor.server.core and ktor.http.jvm
error: module kotlinx.coroutines.core reads package io.ktor.util from both ktor.server.core and ktor.utils.jvm
...................

Support of Java 8 ends quite soon, so it makes sense to start supporting Jigsaw. IMHO, this should be prioritized, as it will require breaking backward compatibility. The less Ktor is popular, the easier would be to break backward compatibility. And Ktor will definitely become more popular over time.

Ktor Version

1.2.0

JVM Version, Operating System and Relevant Context

JDK 12

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:31
  • Comments:24 (6 by maintainers)

github_iconTop GitHub Comments

5reactions
chris-hattoncommented, Jul 7, 2019

This is surely a critical issue to solve; with Ktor being such a new and forward looking framework and others trying to create similarly forward looking libraries and Applications that reference it - we can’t afford to be stuck in Java 8 land any more.

Ktor is already well modularised by artifact; that just needs to be formalised for Java, with a Java Module per Ktor module. There will have to be a brief ‘breaking’ pain of renaming the packages-per-module - but considering the number of dependents on Ktor is set to grow fast - the sooner the better!

4reactions
e5lcommented, Feb 7, 2022

Fixed with 2.0.0

Read more comments on GitHub >

github_iconTop Results From Across the Web

A Guide to Java 9 Modularity - Baeldung
Learn the essentials of building and using modules in Java 9. Start down the path of modularizing your code today.
Read more >
java - Oracle Help Center
Used only with the -jar option. modulepath. Specifies the path to a semicolon-separated (;) list of directories in which each directory is a...
Read more >
Is it possible to mix --class-path and --module-path in javac ...
You can use class path and module path in parallel, but there are a few details to consider. Dependency Module Path ~> Class...
Read more >
Java Module System (JDK 9)
A CLASSPATH is a sequence of classes' base paths and JAR files for the Java Compiler or JVM to locate the classes used...
Read more >
How in Eclipse project module java-9 have modulepath and ...
It would help my understanding though if you first please explain why you need to „assign to this container library entries“. Aside from...
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