Skip to content

Add Add-Opens to JAR manifest#5983

Draft
kwvanderlinde wants to merge 1 commit into
RPTools:developfrom
kwvanderlinde:refactor/5975-run-jar-without-add-opens
Draft

Add Add-Opens to JAR manifest#5983
kwvanderlinde wants to merge 1 commit into
RPTools:developfrom
kwvanderlinde:refactor/5975-run-jar-without-add-opens

Conversation

@kwvanderlinde

@kwvanderlinde kwvanderlinde commented Jun 18, 2026

Copy link
Copy Markdown
Collaborator

Identify the Bug or Feature request

Resolves #5975

Description of the Change

Includes an Add-Opens attribute in the JAR manifest files. This means the user does not have to open these modules via --add-opens on the command line when running MT via java -jar ${jarFile}. Note: the Add-Opens attributed isn't documented until Java 23 but is functional at least as far back as Java 21

The set of modules is defined in one list so that the shadow JAR, regular JAR, gradle :run task, and jpackage image all open the same set of modules.

Opening java.desktop/com.sun.java.swing.plaf.windows was obsolete and so has been removed.

Possible Drawbacks

Should be none

Documentation Notes

N/A

Release Notes

  • Add Add-Opens options to the released JAR manifests so that --add-opens command-line options are not required when running the JAR.

This change is Reviewable

@kwvanderlinde kwvanderlinde self-assigned this Jun 18, 2026
@github-actions github-actions Bot added the code-maintenance Adding/editing javadocs, unit tests, formatting. label Jun 18, 2026
@kwvanderlinde

Copy link
Copy Markdown
Collaborator Author

Keeping this as a draft for now as it should be merged after the other JAR improvement PRs.

@kwvanderlinde kwvanderlinde moved this from Todo to In-Progress in MapTool 1.19 Jun 18, 2026
This means that running the JAR via `java -jar` will not require a bunch of `--add-opens` flags to be manually added on
the command line.

The set of modules is defined in one list, then:
- Compiled into the JAR/shadow JAR manifest's `Add-Opens` list
- Added as `--add-opens` command line options for running from Gradle or the JPackage.
@kwvanderlinde kwvanderlinde force-pushed the refactor/5975-run-jar-without-add-opens branch from 12afad4 to 508650f Compare June 18, 2026 23:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

code-maintenance Adding/editing javadocs, unit tests, formatting.

Projects

Status: In-Progress

Development

Successfully merging this pull request may close these issues.

[Maintenance]: Allow the JAR release to be run without --add-opens

1 participant