kotlin-logging
kotlin-logging copied to clipboard
error: module not found: kotlin.logging
These are my dependencies in build.gradle.kts:
implementation("io.github.microutils:kotlin-logging:1.7.8")
implementation("org.slf4j:slf4j-api:1.7.29")
Then in module-info.java:
requires kotlin.logging;
All the rest works fine with the Java modular approach
However whenever I try to build, then I get:
> Task :compileJava FAILED
6 actionable tasks: 6 executed
C:\Users\elect\IdeaProjects\assimp\src\main\java\module-info.java:13: error: module not found: kotlin.logging
requires kotlin.logging;
What am I doing wrong?
Hi, can you try version 2.0.3? Artifact id is kotlin-logging-jvm in 2.0.3.
Hi, can you try version 2.0.3? Artifact id is kotlin-logging-jvm in 2.0.3.
Similar
C:\Users\elect\IdeaProjects\assimp\src\main\java\module-info.java:13: error: module not found: kotlin.logging.jvm
requires kotlin.logging.jvm;
I found a couple of links that might be helpful. IIUC you should treat kotlin logging as an automatic module. See: https://stackoverflow.com/questions/46741907/what-is-an-automatic-module https://stackoverflow.com/questions/46713289/how-to-use-3rd-party-library-in-java9-module https://stackoverflow.com/questions/56797669/javac-returns-error-module-not-found-ini4j
If that still not help, please try to provide a repo to reproduce it and I will inspect it.
Yeah, I know
PS C:\Users\elect> jar --file=C:\Users\elect\.gradle\caches\modules-2\files-2.1\io.github.microutils\kotlin-logging-jvm\2.0.3\acd404001442be5d98fbaa7ff9df83041cba70fe\kotlin-logging-jvm-2.0.3.jar --describe-module
No module descriptor found. Derived automatic module.
[email protected] automatic
requires java.base mandated
contains mu
contains mu.internal
Repo/branch is here
Hi, After some effort I managed to reproduce it. As a side note I must say it's my first encounter with the module systems and it's not a pleasant one. The web is full of those error messages of all sorts and kinds and solutions are not obvious.
I suspect that this is somehow related to the module-path.java. When I moved the file to Kotlin src folder compile was successful. I am not sure if it's the solution or that in such case the file was ignored. I found one answer in stackoverflow that indicates a similar issue and hints --module-path path is not correct.
Hi, After some effort I managed to reproduce it. As a side note I must say it's my first encounter with the module systems and it's not a pleasant one. The web is full of those error messages of all sorts and kinds and solutions are not obvious.
I suspect that this is somehow related to the
module-path.java. When I moved the file to Kotlin src folder compile was successful. I am not sure if it's the solution or that in such case the file was ignored. I found one answer in stackoverflow that indicates a similar issue and hints--module-pathpath is not correct.
I might help
Take a look at this lib of our. Every module has its own module-info.java and then you need to patch each module by adding the corresponding kotlin sources like here
I have a couple of questions:
- The lib is compiled to java 8. Should it work with that?
- Shouldn't it work out-of-the-box as an automatic module?
- What will happen to users that don't use the module systems if we'll add it?
I have a couple of questions:
* The lib is compiled to java 8. Should it work with that?
No, it won't unfortunately. Only jdk 9+ can recognize that properly
* Shouldn't it work out-of-the-box as an automatic module?
In theory yes, but I guess this works out-of-the-box for java and pretty standard structure projects.
* What will happen to users that don't use the module systems if we'll add it?
I think they won't be affected, but we can give it a try on a separate branch and test it properly before taking some serious/long-term decision
Might be related to #223.
Closing this as fixed with #163.