jpackage: support for environment variables in --java-options

Michael Hall mik3hall at gmail.com
Tue Sep 1 15:54:16 UTC 2020



> On Sep 1, 2020, at 10:30 AM, Andy Herrick <andy.herrick at oracle.com> wrote:
> 
> I have been following this discussion , and feel it is worth pursuing.
> 
> Currently , the values of --arguments and --java-options are pre-processed at launch time by expanding the values of $APPDIR, $ROOTDIR, and $BINDIR to values determined by the native launchers.
> 
> If we can do so without breaking existing functionality we should also expand  environment variables to their values at launch time.
> 
> example:  "--java-options \$USER_JAVA_OPTIONS", "--java-options -Dfoo=\$USER_BAR_VALUE",  "--arguments \$USER_MYAPP_ARGS"
> 
> Developer would have to make sure that the resulting java options or app arguments make sense both with and without the corresponding environment variable set.  jpackage could make sure that an empty option or argument did not cause a problem (as in first and third example above when there is no corresponding env setting).

Actually I think about Serban’s original idea. Which seems would be workable in a lot of cases. Unless you actually need it to be an environment variable.



More information about the core-libs-dev mailing list