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.

The JPMS has been part of the java platform since Java 9, and will be in an LTS release when Java 11 is released in September. Very slowly, projects are adopting the module system, but to do so the libraries that they depend on need to also support modules. It would be really helpful if okhttp had a module-info.class added somehow so we can make proper use of okhttp in a modularised build.

Issue Analytics

  • State:open
  • Created 5 years ago
  • Comments:23 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
robertvazancommented, Jan 4, 2022

@yschimke As a median library developer, I get two immediate benefits from JPMS: Firstly, I can have private packages in my modules, which greatly simplifies design of larger libraries. Secondly, (sometimes extensive) dependencies of my libraries do not pollute downstream projects. Implementing JPMS is straightforward for most libraries. What we are discussing here is an exceptional situation.

1reaction
shs96ccommented, Dec 29, 2021

If there are two jars in the transitive classpath with the same Automatic-Module-Name the Java Module System will be unhappy. Since okhttp-urlconnection depends on okhttp, this means that you can’t currently use okhttp-urlconnection using the module system (though you can place it on the classpath: it’s just the modulepath that will cause problems)

Fortunately, the Automatic-Module-Name is only used by th JPMS, and since this issue suggests it’s not working right now, the obvious fix (to change that value of that manifest entry in the okhttp-urlconnection jar) is safe to make without any concerns about binary compat.

The thing to watch out for are split packages, but this issue doesn’t mention them, so I don’t think that’s an issue here.

Read more comments on GitHub >

github_iconTop Results From Across the Web

What is JPMS? Introducing the Java Platform Module System
The Java Platform Module System (JPMS) is a code-level structure, so it doesn't change the fact that we package Java into JAR files....
Read more >
Understanding Java 9 Modules - Oracle
In this article, I introduce the Java 9 Platform Module System (JPMS), ... A crucial aspect of Java 9 is dividing the JDK...
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 >
Problems with Java modules still plague developers
The main thing JPMS adds to the prior specifications is built-in JVM support, whereas OSGi and JBoss Modules rely on a container abstraction ......
Read more >
A Guide to Java 9 Modularity - Baeldung
... as the Java Platform Module System (JPMS), or “Modules” for short. ... By now, support for Java 9 modules has been added...
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