Manifest Add-Exports vs. command line --add-exports

Tom Hood tom.w.hood at
Wed Aug 16 20:30:28 UTC 2017


I need a little help understanding the difference between "Add-Exports:" in
a jar's manifest vs. the command line arg --add-exports.  I can get
--add-exports to work, but not Add-Exports.

JDK Version: 9 build 181 windows 64

Slide 23 of
for-jdk9-j1-2016.pdf seems to suggest Add-Exports in the manifest as an
alternative to --add-exports

Our webstart-launched app requires a long list of --add-module and/or
--add-exports command line options.  The list is long enough that it
exceeds a limit on number of args and webstart fails to launch the app with
the popup "too many args to run".

Specifically, I was trying to allow jai_imageio.jar (1.0_01) to access
java.base/ by adding
to the java-vm-args in the jnlp.  However, that one additional arg pushed
it over the edge and exceeded the limit.

This is the full j2se element in our jnlp:

<j2se  version="1.9+" initial-heap-size="32m" max-heap-size="3072m"
     java-vm-args="--add-modules=java.corba --add-exports
java.desktop/ --add-exports
java.desktop/sun.swing=ALL-UNNAMED --add-exports
java.desktop/sun.awt=ALL-UNNAMED --add-exports
java.desktop/sun.awt.image=ALL-UNNAMED --add-exports
java.desktop/ --add-exports
java.desktop/ --add-exports
java.desktop/sun.awt.dnd=ALL-UNNAMED --add-exports
java.base/ --add-exports=java.base/

I then removed the last --add-exports to keep under the arg limit and
instead added an Add-Exports line to the jai_imageio.jar

Add-Exports: java.base/

That doesn't appear to be taking affect.  Am I using it incorrectly?

-- Tom

More information about the core-libs-dev mailing list