Script generated using jlink --launcher doesn't espace arguments

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Script generated using jlink --launcher doesn't espace arguments

lists
Hi,

Not quite sure where to report this, but it's a pretty annoying bug making scripts generated using the --launcher parameter unusable for applications accepting complex command line arguments.

When generating a launcher script using jlink, the generated script doesn't escape the arguments it passes through.

The command used to generate the jlink'd image from a maven output:

  jlink --output jlinked \
    -p ../target/libs/:../target/log-timing-parser-1.0.0.jar \
    --add-modules be.yelido.logtimingparser,ch.qos.logback.classic,java.naming \
    --no-header-files \
    --no-man-pages \
    --strip-debug \
    --compress=2 \
    --launcher log-timing-parser=be.yelido.logtimingparser/be.yelido.logtimingparser.Main

The generated script:

  $ cat jlinked/bin/log-timing-parser
  #!/bin/sh
  JLINK_VM_OPTIONS=
  DIR=`dirname $0`
  $DIR/java $JLINK_VM_OPTIONS -m be.yelido.logtimingparser/be.yelido.logtimingparser.Main $@

The expected script:


  $ cat jlinked/bin/log-timing-parser
  #!/bin/sh
  JLINK_VM_OPTIONS=
  DIR=`dirname $0`
  $DIR/java $JLINK_VM_OPTIONS -m be.yelido.logtimingparser/be.yelido.logtimingparser.Main "$@"
Reply | Threaded
Open this post in threaded view
|

Re: Script generated using jlink --launcher doesn't espace arguments

sundararajan.athijegannathan
Thanks for reporting this issue. Filed a bug ->
https://bugs.openjdk.java.net/browse/JDK-8220699

Thanks,
-Sundar

On 14/03/19, 8:19 PM, [hidden email] wrote:

> Hi,
>
> Not quite sure where to report this, but it's a pretty annoying bug making scripts generated using the --launcher parameter unusable for applications accepting complex command line arguments.
>
> When generating a launcher script using jlink, the generated script doesn't escape the arguments it passes through.
>
> The command used to generate the jlink'd image from a maven output:
>
>    jlink --output jlinked \
>      -p ../target/libs/:../target/log-timing-parser-1.0.0.jar \
>      --add-modules be.yelido.logtimingparser,ch.qos.logback.classic,java.naming \
>      --no-header-files \
>      --no-man-pages \
>      --strip-debug \
>      --compress=2 \
>      --launcher log-timing-parser=be.yelido.logtimingparser/be.yelido.logtimingparser.Main
>
> The generated script:
>
>    $ cat jlinked/bin/log-timing-parser
>    #!/bin/sh
>    JLINK_VM_OPTIONS=
>    DIR=`dirname $0`
>    $DIR/java $JLINK_VM_OPTIONS -m be.yelido.logtimingparser/be.yelido.logtimingparser.Main $@
>
> The expected script:
>
>
>    $ cat jlinked/bin/log-timing-parser
>    #!/bin/sh
>    JLINK_VM_OPTIONS=
>    DIR=`dirname $0`
>    $DIR/java $JLINK_VM_OPTIONS -m be.yelido.logtimingparser/be.yelido.logtimingparser.Main "$@"
Reply | Threaded
Open this post in threaded view
|

Re: Script generated using jlink --launcher doesn't espace arguments

Mandy Chung
In reply to this post by lists
I have created https://bugs.openjdk.java.net/browse/JDK-8220700
for this issue.

A better solution would be to get the native launcher support [1]
to replace this stop-gap generated script.

Mandy
[1] https://bugs.openjdk.java.net/browse/JDK-8182555

On 3/14/19 7:49 AM, [hidden email] wrote:
> Hi,
>
> Not quite sure where to report this, but it's a pretty annoying bug
making scripts generated using the --launcher parameter unusable for
applications accepting complex command line arguments.
>
> When generating a launcher script using jlink, the generated script
doesn't escape the arguments it passes through.

>
> The command used to generate the jlink'd image from a maven output:
>
>    jlink --output jlinked \
>      -p ../target/libs/:../target/log-timing-parser-1.0.0.jar \
>      --add-modules be.yelido.logtimingparser,ch.qos.logback.classic,java.naming \
>      --no-header-files \
>      --no-man-pages \
>      --strip-debug \
>      --compress=2 \
>      --launcher log-timing-parser=be.yelido.logtimingparser/be.yelido.logtimingparser.Main
>
> The generated script:
>
>    $ cat jlinked/bin/log-timing-parser
>    #!/bin/sh
>    JLINK_VM_OPTIONS=
>    DIR=`dirname $0`
>    $DIR/java $JLINK_VM_OPTIONS -m be.yelido.logtimingparser/be.yelido.logtimingparser.Main $@
>
> The expected script:
>
>
>    $ cat jlinked/bin/log-timing-parser
>    #!/bin/sh
>    JLINK_VM_OPTIONS=
>    DIR=`dirname $0`
>    $DIR/java $JLINK_VM_OPTIONS -m be.yelido.logtimingparser/be.yelido.logtimingparser.Main "$@"
>