The jpackager cfg file originally was a properties file, but was transitioned to have sections in them:
[APPLICATION]
[JavaOptions]
[ArgOptions]
The content of the first section are still properties, all of the form key=value.
But all the entries seem to be treated as properties.
as a result when you run the following:
$JDK_HOME/bin/jpackage create-app-image \
--output output \
--name mod \
--module 'me.mymodule/me.mymodule.Main' \
--module-path 'input-mods/mods;input/other-mods' \
--java-options --add-exports=java.base/sun.util=me.mymodule.foo,ALL-UNNAMED \
--java-options --add-exports=java.base/sun.security.util=other.mod.bar,ALL-UNNAMED \
you get the correct config file:
----------------------------
[Application]
app.name=mod
app.version=1.0
app.runtime=$APPDIR\runtime
app.identifier=me.mymodule
app.classpath=
app.mainmodule=me.mymodule/me.mymodule.Main
[JavaOptions]
--add-exports=java.base/sun.util=me.mymodule.foo,ALL-UNNAMED
--add-exports=java.base/sun.security.util=other.mod.bar,ALL-UNNAMED
[ArgOptions]
------------------------------
but when you run it the arguments passed to vm are:
--add-exports=java.base/sun.util=me.mymodule.foo,ALL-UNNAMED
--add-exports=java.base/sun.util=me.mymodule.foo,ALL-UNNAMED
because the IniFile.cpp splits these into key, value pairs, and since the keys are the same, only one value can exist, so even though It passes two args, they are the same.
This seems to happen to any vm args that contain equals sign and are the same preceeding the equals sign.
[APPLICATION]
[JavaOptions]
[ArgOptions]
The content of the first section are still properties, all of the form key=value.
But all the entries seem to be treated as properties.
as a result when you run the following:
$JDK_HOME/bin/jpackage create-app-image \
--output output \
--name mod \
--module 'me.mymodule/me.mymodule.Main' \
--module-path 'input-mods/mods;input/other-mods' \
--java-options --add-exports=java.base/sun.util=me.mymodule.foo,ALL-UNNAMED \
--java-options --add-exports=java.base/sun.security.util=other.mod.bar,ALL-UNNAMED \
you get the correct config file:
----------------------------
[Application]
app.name=mod
app.version=1.0
app.runtime=$APPDIR\runtime
app.identifier=me.mymodule
app.classpath=
app.mainmodule=me.mymodule/me.mymodule.Main
[JavaOptions]
--add-exports=java.base/sun.util=me.mymodule.foo,ALL-UNNAMED
--add-exports=java.base/sun.security.util=other.mod.bar,ALL-UNNAMED
[ArgOptions]
------------------------------
but when you run it the arguments passed to vm are:
--add-exports=java.base/sun.util=me.mymodule.foo,ALL-UNNAMED
--add-exports=java.base/sun.util=me.mymodule.foo,ALL-UNNAMED
because the IniFile.cpp splits these into key, value pairs, and since the keys are the same, only one value can exist, so even though It passes two args, they are the same.
This seems to happen to any vm args that contain equals sign and are the same preceeding the equals sign.