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

The jar-in-jar loader does not support multi-release JARs #1057

Closed
ppkarwasz opened this issue Jan 10, 2024 · 1 comment · Fixed by #1058
Closed

The jar-in-jar loader does not support multi-release JARs #1057

ppkarwasz opened this issue Jan 10, 2024 · 1 comment · Fixed by #1058
Labels
help wanted Extra attention is needed

Comments

@ppkarwasz
Copy link
Contributor

To handle multi-release JARs, Java 9 extends the format of jar: URLs:

  • if the URL has a #runtime fragment, the JAR file is opened in multi-release mode,
  • otherwise the JAR file is opened in mono-release mode.

See, e.g.:

https://github.com/openjdk/jdk/blob/88378ed0584c7eb0849b6fc1e361fd8ea0698caf/src/java.base/share/classes/java/net/JarURLConnection.java#L178-L186

The #runtime fragment is propagated to the URL of the jar file to allow JarUrlConnection to open the file in multi-release mode.

The jar-in-jar loader strips this fragment from rsrc: URLs and therefore breaks multi-release JARs.

Minimal reproducible example

You can find a minimal reproducible example here:

https://github.com/copernik-eu/bug-reproducibility/tree/main/eclipse-jar-in-jar

@iloveeclipse iloveeclipse added the help wanted Extra attention is needed label Jan 10, 2024
@iloveeclipse
Copy link
Member

Contributions are welcome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants