Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8293040

Argfile documentation for java launcher tool is confusing regarding usage of wildcards

XMLWordPrintable

    • Icon: Task Task
    • Resolution: Fixed
    • Icon: P4 P4
    • 24
    • 11, 17, 18, 22, 23
    • tools
    • b25

      The documentation covering the usage of wildcards in argfiles is confusing and easily misinterpretation.

      https://docs.oracle.com/en/java/javase/18/docs/specs/man/java.html#java-command-line-argument-files

      Specifically these two items
      > The launcher doesn't expand wildcards that are present within an argument file.
      > Wildcards (*) aren't allowed in these lists (such as specifying *.java).

      Can be misinterpreted by users that arguments like the following:

      -cp path/to/my/libs/* or -Xlog:gc*=info,heap*=info

      Aren't allowed/wouldn't work because they include a wildcard. However the prohibition on wildcards is much more narrowly related to expansion that would be done by the shell.

      Suggest the following:

      Remove this line:

      > The launcher doesn't expand wildcards that are present within an argument file.

      And update this line:
      > Wildcards (*) aren't allowed in these lists (such as specifying *.java).

      Updated to be:
      > Wildcards (*) aren't allowed for list expansion (such as specifying /*.java).
      And with a sub-bullet:
      > Wilcards are allowed in VM arguments like setting classpath (-cp /path/to/libs/*, or configuring VM logging -X:log:gc*=info)

            cstein Christian Stein
            bkorando Billy Korando
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: