Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

3.4.0 module name problems #1306

Open
barchetta opened this issue Jul 24, 2023 · 3 comments
Open

3.4.0 module name problems #1306

barchetta opened this issue Jul 24, 2023 · 3 comments

Comments

@barchetta
Copy link

In 3.4.0:

  • okio-3.4.0.jar has no Automatic-Module-Name specified. Therefore its derived module name is okio
  • okio-jvm-3.4.0.jar has Automatic-Module-Name: okio . Therefore its module name is also okio

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.

@swankjesse
Copy link
Collaborator

swankjesse commented Jul 26, 2023

As a workaround I recommend excluding the non-JVM artifact from your module path.

barchetta added a commit to barchetta/helidon that referenced this issue Jul 26, 2023
barchetta added a commit to helidon-io/helidon that referenced this issue Jul 27, 2023
* Force upgrade of okio common to 3.4.0
* Suppress graalvm-sdk false positive
* Work-around modularity issues with okio (square/okio#1306)
@jensli
Copy link

jensli commented Dec 6, 2023

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.

@bowbahdoe
Copy link

bowbahdoe commented Jul 9, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants