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

Add ToolProvider support for Java Packager

XMLWordPrintable

    • Icon: CSR CSR
    • Resolution: Approved
    • Icon: P2 P2
    • 10
    • deploy
    • None
    • behavioral
    • minimal
    • Minimal risk, it won't affect existing functionality.
    • Java API
    • JDK

      Summary

      Add ToolProvider support for Java Packager.

      Problem

      Currently, in order to use Java Packager from the code users need to import some packages (like com.oracle.tools.packager.*) and use it via non-standard API. We can simplify it by adding a ToolProvider support.

      Solution

      Introduce the ToolProvider support. Add a new class in jdk.packager.internal.Main(JavaPackagerToolProvider) that implements java.util.spi.ToolProvider. Add "provides java.util.spi.ToolProvider with ..." in module-info.java for jdk.packager module.

      Specification

      The changes for jdk.packager module \ module-info.java:

      provides java.util.spi.ToolProvider with jdk.packager.internal.Main.JavaPackagerToolProvider;

      The following definition will be added in the module-info.java for jdk.packager:

      /**
       * Defines the Java packager tool, javapackager.
       * The javapackager is a tool for generating bundles for self-contained applications.
       * It can be located under the name {@code "javapackager"} using the {@link ToolProvider}, for example:
       * <pre>{@code
       * ToolProvider javaPackager = ToolProvider.findFirst("javapackager").orElseThrow(...);
       * javaPackager.run(...);
       * }</pre>
       */

            vdrozdov Victor Drozdov (Inactive)
            vdrozdov Victor Drozdov (Inactive)
            Alan Bateman, Alexander Matveev, Kevin Rushforth
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: