okio
okio copied to clipboard
3.4.0 module name problems
In 3.4.0:
-
okio-3.4.0.jar
has noAutomatic-Module-Name
specified. Therefore its derived module name isokio
-
okio-jvm-3.4.0.jar
hasAutomatic-Module-Name: okio
. Therefore its module name is alsookio
When you try to run an application with both of those jar's on the module path (java --module-path
) you get an error:
java.lang.module.FindException: Two versions of module okio found in target/libs (okio-3.4.0.jar and okio-jvm-3.4.0.jar)
In 1.17.5 there is no okio-jvm-*.jar
and okio-*.jar
has Automatic-Module-Name: okio
and this problem did not exist.
As a workaround I recommend excluding the non-JVM artifact from your module path.
I ran in to this problem in a modular Java application that uses OkHttp.
I suggest this simple solution to the okio developers: Add an "Automatic-Module-Name" entry to the manifest of okio-x.x.x.jar
also. Call it for example okio-top-level
. Then the two module names will not conflict any more.
That would not be enough.
Not only do those two jars have the same inferred module name, they both have classes in the okio
package. This is a split package and will just never work on the module path.
This requires a deeper fix.