jpackage: spaces in --java-options
Serban Iordache
serban.iordache at gmail.com
Fri Jul 12 07:53:41 UTC 2019
Currently, there is no easy way to pass system properties containing spaces
to the Java runtime.
For example, if we execute jpackage with:
--java-options -Dlabel="my great app"
The resulting configuration file will contain:
[JavaOptions]
-Dlabel=my
great
app
instead of the desired:
[JavaOptions]
-Dlabel=my great app
Looking at the regexp used by jdk.jpackage.internal.Arguments, I came up
with a workaround: surrounding the spaces with \"
This means that executing jpackage with:
--java-options -Dlabel="my\" \"great\" \"app"
will produce the desired output in the configuration file:
[JavaOptions]
-Dlabel=my great app
But this is an ugly hack. It would be nice to have a better way to handle
JVM options containing spaces.
Another issue is related to passing JVM options containing simple or double
quotes. For example, I couldn't find a way to make jpackage generate a
configuration file that contains:
[JavaOptions]
-Dlabel=my "great" app
Best regards,
Serban Iordache
More information about the core-libs-dev
mailing list