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

jlink plugins for vendor information and command-line options

    Details

    • Type: CSR
    • Status: Closed
    • Priority: P3
    • Resolution: Approved
    • Fix Version/s: 11-pool
    • Component/s: tools
    • Labels:
      None
    • Subcomponent:
    • Compatibility Risk:
      minimal
    • Compatibility Risk Description:
      These new options are strictly additive; they do not affect the behavior of any existing `jlink` options or functionality.
    • Interface Kind:
      System or security property, add/remove/modify command line option

      Description

      Summary

      Extend the jlink tool with options to update the vendor version string, the vendor bug URL, and the vendor VM bug URL in the resulting image, and to allow VM command-line options to be saved in the image.

      Problem

      The jlink tool can already be used to create a custom run-time image, but some uses require additional customization:

      • If the resulting image is distributed to end users, it can be useful to change some of the vendor information, such as the vendor version string and the URLs for bug reports.

      • In some cases, the virtual machine in the resulting image must be started with additional, baked-in command-line options.

      Solution

      Define new jlink plugins to implement the desired options.

      Specification

      The new jlink plugins will implement the following options:

      • --vendor-bug-url=<vendor-bug-url> overrides the vendor bug URL baked into the build. The value of the system property "java.vendor.url.bug" will be <vendor-bug-url>.

      • --vendor-vm-bug-url=<vendor-vm-bug-url> overrides the vendor VM bug URL baked into the build. This value will be displayed in VM crash logs.

      • --vendor-version=<vendor-version> overrides the vendor version string baked into the build, if any. The value of the system property "java.vendor.version" will be <vendor-version>. This value will be displayed in the output of java --version.

      • --add-options=<options> prepends the specified <options> string, which may include whitespace, before any other options when invoking the VM in the resulting image.

      Example usage:

      $ jlink --add-modules java.base --output /tmp/jre --vendor-version='XyzzyVM 3.14.15' --vendor-bug-url=https://bugs.xyzzy.com/ --add-options='-Dfoo=xyzzy'
      $ /tmp/jre/bin/java -XshowSettings:properties --version 2>&1 | grep -i xyzzy
          foo = xyzzy
          java.vendor.url.bug = https://bugs.xyzzy.com/
          java.vendor.version = XyzzyVM 3.14.15
      OpenJDK Runtime Environment XyzzyVM 3.14.15 (build 14-mr+0-cjdk-81d748451934)
      OpenJDK 64-Bit Server VM XyzzyVM 3.14.15 (build 14-mr+0-cjdk-81d748451934, mixed mode)
      $

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                clanger Christoph Langer
                Reporter:
                mr Mark Reinhold
                Reviewed By:
                Matthias Baesken
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: