-
Notifications
You must be signed in to change notification settings - Fork 9.2k
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
Add Module Support for OkHttp to Improve Compatibility with jlink and Java 9+ Modules #8588
Comments
OkHttp added Automatic-Module-Name entries quite a while ago. And hopefully the overlapping modules are now split out. https://github.com/square/okhttp/pull/3743/files If I understand correctly, this is a limitation of jlink with such dependencies? I think we previously pushed back on full support as it was expected to be quite disruptive for both development and builds. |
Is it possible to support jlink and JDK 8+ simultaneously? |
Yeah you can put the |
Hi @swankjesse Long time no speak. I hope you're doing well :) Any chance of getting I can help answer any questions you might have regarding supporting both Java 8 and Java9+ simultaneously. And while we're on the topic, are there any plans to move off JDK 8 in the foreseeable future? Thanks. |
|
@boheastill I don't understand why you closed this issue.
Please elaborate. If you already worked out the split package problems, all that remains is adding |
Title: Add Module Support for OkHttp to Improve Compatibility with
jlink
and Java 9+ ModulesDescription:
I am currently working on a project using OkHttp (version 4.x / 5.0.0-alpha.14) and encountered an issue while trying to create a modular application in a Java 9+ environment using
jlink
. The problem stems from the fact that OkHttp does not declare its own module via amodule-info.java
file, which leads to compatibility issues with the Java Platform Module System (JPMS).The absence of module declarations in OkHttp causes errors during
jlink
modular application creation, as OkHttp internally uses modules (such asokio
), but it does not provide explicit module definitions, resulting in runtime conflicts and build failures.Suggested Solution:
I recommend adding official module support to OkHttp as follows:
module-info.java
:Include a
module-info.java
file in the OkHttp repository, declaring the necessary modules. For example:Ensure Compatibility with JPMS:
Ensure that OkHttp works seamlessly with the Java Platform Module System (JPMS) and can function correctly in modular applications, especially when using the
jlink
build tool.Provide a Version with Module Support:
If full module support cannot be achieved immediately, would it be possible to provide a clear roadmap or plan to help users understand the progress on module support and avoid issues when migrating to modular Java applications?
Background:
Currently, OkHttp does not declare any modules. While it works fine with JDK 8 and earlier versions, the lack of module support becomes problematic in Java 9+ environments, particularly when using
jlink
for creating custom Java runtimes. This issue is especially prominent becausejlink
requires all dependencies to have clear module declarations.Expected Outcome:
By adding module support for OkHttp, developers will be able to:
jlink
.Thanks: Thank you for considering this request. I believe that adding module support for OkHttp will greatly improve its usability in modern modular Java applications.
This version is ready for submission. Let me know if you’d like to make any changes or need further adjustments!
The text was updated successfully, but these errors were encountered: