On Tue, Apr 25, 2023 at 2:48 PM Alan Bateman <alan.bate...@oracle.com> wrote:
> The command line parsing in jlink doesn't currently allow the argument for > a plugin use GNU style options. There are workarounds, e.g. `--add-options > \ --add-modules=foo,bar` so you mileage might vary on this. > I'm calling jlink through its ToolProvider and it does indeed work to simply add a space just before --add-modules=, like this: String[] options = new String[] {"--add-options", " --add-modules=" +String.join(",", addModules), ...}; The leading space makes following check of the --add-options param value in TaskHelper.OptionsHelper not match and throw BadArgs: if (param == null || param.isEmpty() > || (param.length() >= 2 && param.charAt(0) == '-' > && param.charAt(1) == '-')) { > throw new BadArgs("err.missing.arg", name). > showUsage(true); > } The logic here could probably be improved. Thanks, Eirik.