jpackage multiple --add-exports

Craig Bester cycraig33 at
Mon May 20 19:36:16 UTC 2019


When using the JDK13-EA jpackage utility (
specifying multiple ‘--add-exports' arguments with ’--java-options' results
in the executable only passing the first ‘--add-exports' to the JVM.

For example, if the .cfg file generated by jpackage holds the following


The second ‘--add-exports' will be ignored and an IllegalAccessError will be
thrown when attempting to access anything under The same issue occurs when using the
older javapackager too. Switching the order of the statements causes calls to throw an IllegalAccessError instead.

Running the jar directly works fine: “java --module-path=.
--add-modules=jdk.unsupported.desktop,javafx.controls,javafx.swing -jar

Is there an alternative method to specify exports when packaging a jar?
Specifying ‘Add-Exports’ in the jar manifest does not work.

Sent from:

More information about the core-libs-dev mailing list