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

jlink plugins for setting java.vendor, java.vm.vendor and java.vendor.url

XMLWordPrintable

    • Icon: CSR CSR
    • Resolution: Unresolved
    • Icon: P4 P4
    • 25
    • tools
    • None
    • behavioral
    • low
    • Hide
      The default build from OpenJDK without customization or `--with-vendor-name='N/A'` will have `java.vm.vendor` changed from "Oracle Corporation" to "N/A".
      Show
      The default build from OpenJDK without customization or `--with-vendor-name='N/A'` will have `java.vm.vendor` changed from "Oracle Corporation" to "N/A".
    • add/remove/modify command line option
    • JDK

      Summary

      Extend the 'jlink' tool with options to customize the java.vendor, java.vm.vendor and java.vendor.url system properties in the resulting image.

      Problem

      Downstream distributions of JDK would like to customize system properties related to the vendor information.

      Currently the build system supports using branding.conf to customize those properties. However, the java.vm.vendor value is hardcoded to "Oracle Corporation" unless the build is configured with the --with-vendor-name option. Also java.vm.vendor should have the same default value ("N/A") as the java.vendor system property.

      The jlink tool can be used to create a custom run-time image with altered values for several "java.vendor.*" system properties, but is missing the capability to update java.vendor, java.vm.vendor and java.vendor.url system properties.

      Solution

      Define new jlink plugins to implement the desired options. The default value for java.vm.vendor is "N/A", the same default value as java.vendor.

      Specification

      The new jlink plugins will implement the following options:

      • --vendor=<vendor> override the vendor string baked into the build, if any. The value of the system property "java.vendor" will be <vendor>.

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

      • --vendor-vm <vendor> override the vendor string baked into the build, if any. The value of the system property "java.vm.vendor" will be <vendor>.

      Example usage:

      $ jlink --add-modules java.base --output /tmp/jre --vendor 'Example Corp.' --vendor-url https://example.com --vendor-vm 'Example VM'
      $ /tmp/jre/bin/java -XshowSettings:properties --version 2>&1 | grep -i example
          java.vendor = Example Corp.
          java.vendor.url = https://example.com
          java.vm.vendor = Example VM
      $

      In addition, the value of java.vm.vendor system property is "N/A" by default unless the build is configured with --with-vendor-name option to specify the vendor which will be set in java.vendor and java.vm.vendor.

            henryjen Henry Jen
            jeisl Josef Eisl
            Alan Bateman, Mandy Chung (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: