8223241: jpackage cleanup from code review JDK-8200758-branch
authorherrick
Thu, 06 Jun 2019 19:18:09 -0400
branchJDK-8200758-branch
changeset 57392 46d4b0aa4542
parent 57391 970f28090a06
child 57393 85998c745ee9
8223241: jpackage cleanup from code review Reviewed-by: asemenyuk, almatvee
src/jdk.jpackage/linux/classes/jdk/jpackage/internal/LinuxAppBundler.java
src/jdk.jpackage/linux/classes/jdk/jpackage/internal/LinuxAppImageBuilder.java
src/jdk.jpackage/linux/classes/jdk/jpackage/internal/LinuxDebBundler.java
src/jdk.jpackage/linux/classes/jdk/jpackage/internal/LinuxRpmBundler.java
src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/MacAppImageBuilder.java
src/jdk.jpackage/share/classes/jdk/jpackage/internal/AbstractAppImageBuilder.java
src/jdk.jpackage/share/classes/jdk/jpackage/internal/AbstractBundler.java
src/jdk.jpackage/share/classes/jdk/jpackage/internal/AbstractImageBundler.java
src/jdk.jpackage/share/classes/jdk/jpackage/internal/Arguments.java
src/jdk.jpackage/share/classes/jdk/jpackage/internal/BundleParams.java
src/jdk.jpackage/share/classes/jdk/jpackage/internal/JLinkBundlerHelper.java
src/jdk.jpackage/share/classes/jdk/jpackage/internal/JPackageToolProvider.java
src/jdk.jpackage/share/classes/jdk/jpackage/internal/StandardBundlerParam.java
src/jdk.jpackage/share/classes/jdk/jpackage/internal/ValidOptions.java
src/jdk.jpackage/share/classes/jdk/jpackage/internal/resources/HelpResources.properties
src/jdk.jpackage/share/classes/jdk/jpackage/internal/resources/HelpResources_ja.properties
src/jdk.jpackage/share/classes/jdk/jpackage/internal/resources/HelpResources_zh_CN.properties
src/jdk.jpackage/share/classes/jdk/jpackage/internal/resources/MainResources.properties
src/jdk.jpackage/share/classes/jdk/jpackage/internal/resources/MainResources_ja.properties
src/jdk.jpackage/share/classes/jdk/jpackage/internal/resources/MainResources_zh_CN.properties
src/jdk.jpackage/share/classes/jdk/jpackage/internal/resources/ResourceLocator.java
src/jdk.jpackage/share/classes/jdk/jpackage/main/Main.java
src/jdk.jpackage/share/classes/module-info.java
test/jdk/tools/jpackage/JPackageVersionTest.java
--- a/src/jdk.jpackage/linux/classes/jdk/jpackage/internal/LinuxAppBundler.java	Thu Jun 06 19:14:02 2019 -0400
+++ b/src/jdk.jpackage/linux/classes/jdk/jpackage/internal/LinuxAppBundler.java	Thu Jun 06 19:18:09 2019 -0400
@@ -42,7 +42,7 @@
     private static final ResourceBundle I18N = ResourceBundle.getBundle(
             "jdk.jpackage.internal.resources.LinuxResources");
 
-    public static final BundlerParamInfo<File> ICON_PNG =
+    static final BundlerParamInfo<File> ICON_PNG =
             new StandardBundlerParam<>(
             "icon.png",
             File.class,
@@ -57,7 +57,7 @@
             },
             (s, p) -> new File(s));
 
-    public static final BundlerParamInfo<String> LINUX_INSTALL_DIR =
+    static final BundlerParamInfo<String> LINUX_INSTALL_DIR =
             new StandardBundlerParam<>(
             "linux-install-dir",
             String.class,
@@ -74,7 +74,7 @@
             (s, p) -> s
     );
 
-    public static final BundlerParamInfo<String> LINUX_PACKAGE_DEPENDENCIES =
+    static final BundlerParamInfo<String> LINUX_PACKAGE_DEPENDENCIES =
             new StandardBundlerParam<>(
             Arguments.CLIOptions.LINUX_PACKAGE_DEPENDENCIES.getId(),
             String.class,
@@ -115,11 +115,11 @@
 
     // it is static for the sake of sharing with "installer" bundlers
     // that may skip calls to validate/bundle in this class!
-    public static File getRootDir(File outDir, Map<String, ? super Object> p) {
+    static File getRootDir(File outDir, Map<String, ? super Object> p) {
         return new File(outDir, APP_NAME.fetchFrom(p));
     }
 
-    public static String getLauncherCfgName(Map<String, ? super Object> p) {
+    static String getLauncherCfgName(Map<String, ? super Object> p) {
         return "app/" + APP_NAME.fetchFrom(p) +".cfg";
     }
 
@@ -178,7 +178,7 @@
         return getAppBundleParameters();
     }
 
-    public static Collection<BundlerParamInfo<?>> getAppBundleParameters() {
+    static Collection<BundlerParamInfo<?>> getAppBundleParameters() {
         return Arrays.asList(
                 APP_NAME,
                 APP_RESOURCES,
--- a/src/jdk.jpackage/linux/classes/jdk/jpackage/internal/LinuxAppImageBuilder.java	Thu Jun 06 19:14:02 2019 -0400
+++ b/src/jdk.jpackage/linux/classes/jdk/jpackage/internal/LinuxAppImageBuilder.java	Thu Jun 06 19:18:09 2019 -0400
@@ -144,15 +144,6 @@
         }
     }
 
-    private static void createUtf8File(File file, String content)
-            throws IOException {
-        try (OutputStream fout = new FileOutputStream(file);
-            Writer output = new OutputStreamWriter(fout, "UTF-8")) {
-            output.write(content);
-        }
-    }
-
-
     // it is static for the sake of sharing with "installer" bundlers
     // that may skip calls to validate/bundle in this class!
     public static File getRootDir(File outDir, Map<String, ? super Object> p) {
--- a/src/jdk.jpackage/linux/classes/jdk/jpackage/internal/LinuxDebBundler.java	Thu Jun 06 19:14:02 2019 -0400
+++ b/src/jdk.jpackage/linux/classes/jdk/jpackage/internal/LinuxDebBundler.java	Thu Jun 06 19:18:09 2019 -0400
@@ -33,8 +33,6 @@
 import java.nio.file.attribute.PosixFilePermissions;
 import java.text.MessageFormat;
 import java.util.*;
-import java.util.logging.Level;
-import java.util.logging.Logger;
 import java.util.regex.Pattern;
 
 import static jdk.jpackage.internal.StandardBundlerParam.*;
@@ -356,8 +354,8 @@
                 Files.setPosixFilePermissions(file.toPath(), filePermissions);
             }
         } catch (IOException ex) {
-            Logger.getLogger(LinuxDebBundler.class.getName()).log(
-                    Level.SEVERE, null, ex);
+            Log.error(ex.getMessage());
+            Log.verbose(ex);
         }
 
     }
--- a/src/jdk.jpackage/linux/classes/jdk/jpackage/internal/LinuxRpmBundler.java	Thu Jun 06 19:14:02 2019 -0400
+++ b/src/jdk.jpackage/linux/classes/jdk/jpackage/internal/LinuxRpmBundler.java	Thu Jun 06 19:18:09 2019 -0400
@@ -33,8 +33,6 @@
 import java.nio.file.attribute.PosixFilePermissions;
 import java.text.MessageFormat;
 import java.util.*;
-import java.util.logging.Level;
-import java.util.logging.Logger;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 
--- a/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/MacAppImageBuilder.java	Thu Jun 06 19:14:02 2019 -0400
+++ b/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/MacAppImageBuilder.java	Thu Jun 06 19:18:09 2019 -0400
@@ -815,8 +815,6 @@
                 })
                 .filter(p -> Files.isRegularFile(p) &&
                         !(p.toString().contains("/Contents/MacOS/libjli.dylib")
-                        || p.toString().contains(
-                                "/Contents/MacOS/JavaAppletPlugin")
                         || p.toString().endsWith(appExecutable))
                 ).forEach(p -> {
             //noinspection ThrowableResultOfMethodCallIgnored
--- a/src/jdk.jpackage/share/classes/jdk/jpackage/internal/AbstractAppImageBuilder.java	Thu Jun 06 19:14:02 2019 -0400
+++ b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/AbstractAppImageBuilder.java	Thu Jun 06 19:18:09 2019 -0400
@@ -43,6 +43,12 @@
 
 import static jdk.jpackage.internal.StandardBundlerParam.*;
 
+/*
+ * AbstractAppImageBuilder
+ *     This is sub-classed by each of the platform dependent AppImageBuilder
+ * classes, and contains resource processing code common to all platforms. 
+ */
+
 public abstract class AbstractAppImageBuilder {
 
     private static final ResourceBundle I18N = ResourceBundle.getBundle(
--- a/src/jdk.jpackage/share/classes/jdk/jpackage/internal/AbstractBundler.java	Thu Jun 06 19:14:02 2019 -0400
+++ b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/AbstractBundler.java	Thu Jun 06 19:18:09 2019 -0400
@@ -51,7 +51,7 @@
     private static final ResourceBundle I18N = ResourceBundle.getBundle(
             "jdk.jpackage.internal.resources.MainResources");
 
-    public static final BundlerParamInfo<File> IMAGES_ROOT =
+    static final BundlerParamInfo<File> IMAGES_ROOT =
             new StandardBundlerParam<>(
             "imagesRoot",
             File.class,
--- a/src/jdk.jpackage/share/classes/jdk/jpackage/internal/AbstractImageBundler.java	Thu Jun 06 19:14:02 2019 -0400
+++ b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/AbstractImageBundler.java	Thu Jun 06 19:18:09 2019 -0400
@@ -43,7 +43,7 @@
  * It contains methods and parameters common to all Image Bundlers.
  *
  * Application Image Bundlers are created in "create-app-image" mode,
- * or as an intermeadiate step in "create-installer" mode.
+ * or as an intermediate step in "create-installer" mode.
  *
  * The concrete implementations are in the platform specific Bundlers.
  */
--- a/src/jdk.jpackage/share/classes/jdk/jpackage/internal/Arguments.java	Thu Jun 06 19:14:02 2019 -0400
+++ b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/Arguments.java	Thu Jun 06 19:18:09 2019 -0400
@@ -72,7 +72,7 @@
     private static final String FA_DESCRIPTION = "description";
     private static final String FA_ICON = "icon";
 
-    public static final BundlerParamInfo<Boolean> CREATE_APP_IMAGE =
+    static final BundlerParamInfo<Boolean> CREATE_APP_IMAGE =
             new StandardBundlerParam<>(
                     APPIMAGE_MODE,
                     Boolean.class,
@@ -80,7 +80,7 @@
                     (s, p) -> (s == null || "null".equalsIgnoreCase(s)) ?
                             true : Boolean.valueOf(s));
 
-    public static final BundlerParamInfo<Boolean> CREATE_INSTALLER =
+    static final BundlerParamInfo<Boolean> CREATE_INSTALLER =
             new StandardBundlerParam<>(
                     INSTALLER_MODE,
                     Boolean.class,
@@ -107,7 +107,6 @@
     private boolean hasMainClass = false;
     private boolean hasMainModule = false;
     private boolean hasTargetFormat = false;
-    private boolean hasAppImage = false;
     public boolean userProvidedBuildRoot = false;
 
     private String buildRoot = null;
@@ -283,10 +282,7 @@
 
         INSTALL_DIR ("install-dir", OptionCategories.PROPERTY),
 
-        PREDEFINED_APP_IMAGE ("app-image", OptionCategories.PROPERTY, ()-> {
-            setOptionValue("app-image", popArg());
-            context().hasAppImage = true;
-        }),
+        PREDEFINED_APP_IMAGE ("app-image", OptionCategories.PROPERTY),
 
         PREDEFINED_RUNTIME_IMAGE ("runtime-image", OptionCategories.PROPERTY),
 
--- a/src/jdk.jpackage/share/classes/jdk/jpackage/internal/BundleParams.java	Thu Jun 06 19:14:02 2019 -0400
+++ b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/BundleParams.java	Thu Jun 06 19:18:09 2019 -0400
@@ -113,17 +113,17 @@
         params.putAll(p);
     }
 
-    public <C> C fetchParam(BundlerParamInfo<C> paramInfo) {
+    public <T> T fetchParam(BundlerParamInfo<T> paramInfo) {
         return paramInfo.fetchFrom(params);
     }
 
     @SuppressWarnings("unchecked")
-    public <C> C fetchParamWithDefault(
-            Class<C> klass, C defaultValue, String... keys) {
+    public <T> T fetchParamWithDefault(
+            Class<T> klass, T defaultValue, String... keys) {
         for (String key : keys) {
             Object o = params.get(key);
             if (klass.isInstance(o)) {
-                return (C) o;
+                return (T) o;
             } else if (params.containsKey(key) && o == null) {
                 return null;
             } else if (o != null) {
@@ -133,7 +133,7 @@
         return defaultValue;
     }
 
-    public <C> C fetchParam(Class<C> klass, String... keys) {
+    public <T> T fetchParam(Class<T> klass, String... keys) {
         return fetchParamWithDefault(klass, null, keys);
     }
 
@@ -271,12 +271,8 @@
     // assuming that application was packaged according to the rules
     // we must have application jar, i.e. jar where we embed launcher
     // and have main application class listed as main class!
-    // If there are more than one, or none - it will be treated as
-    // deployment error
-    //
-    // Note we look for both JavaFX executable jars and regular executable jars
-    // As long as main "application" entry point is the same it is main class
-    // (i.e. for FX jar we will use JavaFX manifest entry ...)
+    // If there are more than one, or none - it will be treated as an error
+
     public String getMainApplicationJar() {
         jdk.jpackage.internal.RelativeFileSet appResources = getAppResource();
         if (mainJar != null) {
--- a/src/jdk.jpackage/share/classes/jdk/jpackage/internal/JLinkBundlerHelper.java	Thu Jun 06 19:14:02 2019 -0400
+++ b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/JLinkBundlerHelper.java	Thu Jun 06 19:18:09 2019 -0400
@@ -63,10 +63,6 @@
 
     private static final ResourceBundle I18N = ResourceBundle.getBundle(
             "jdk.jpackage.internal.resources.MainResources");
-    private static final String JRE_MODULES_FILENAME =
-            "jdk/jpackage/internal/resources/jre.list";
-    private static final String SERVER_JRE_MODULES_FILENAME =
-            "jdk/jpackage/internal/resources/jre.module.list";
 
     static final ToolProvider JLINK_TOOL =
             ToolProvider.findFirst("jlink").orElseThrow();
--- a/src/jdk.jpackage/share/classes/jdk/jpackage/internal/JPackageToolProvider.java	Thu Jun 06 19:14:02 2019 -0400
+++ b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/JPackageToolProvider.java	Thu Jun 06 19:18:09 2019 -0400
@@ -44,7 +44,9 @@
             PrintWriter out, PrintWriter err, String... args) {
         try {
             return new jdk.jpackage.main.Main().execute(out, err, args);
-        } catch (Exception ignored) {
+        } catch (RuntimeException re) {
+            Log.error(re.getMessage());
+            Log.verbose(re);
             return 1;
         }
     }
--- a/src/jdk.jpackage/share/classes/jdk/jpackage/internal/StandardBundlerParam.java	Thu Jun 06 19:14:02 2019 -0400
+++ b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/StandardBundlerParam.java	Thu Jun 06 19:18:09 2019 -0400
@@ -132,7 +132,6 @@
                     (s, p) -> getMainJar(s, p)
             );
 
-    // TODO: test CLASSPATH jar manifest Attributet
     static final StandardBundlerParam<String> CLASSPATH =
             new StandardBundlerParam<>(
                     "classpath",
--- a/src/jdk.jpackage/share/classes/jdk/jpackage/internal/ValidOptions.java	Thu Jun 06 19:14:02 2019 -0400
+++ b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/ValidOptions.java	Thu Jun 06 19:18:09 2019 -0400
@@ -39,11 +39,15 @@
  * initArgs()
  *      Computes the Map of valid options for each mode on this Platform.
  *
- * checkIfSupported(CLIOptions mode, CLIOptions arg)
- *      Determine if the given arg is valid in the given mode.
+ * checkIfSupported(CLIOptions arg)
+ *      Determine if the given arg is valid on this platform.
  *
- * checkIfOtherSupported(CLIOptions mode, CLIOptions arg)
- *      Determine if the given arg is valid in the a different mode.
+ * checkIfImageSupported(CLIOptions arg)
+ *      Determine if the given arg is valid for creating app image.
+ *
+ * checkIfInstallerSupported(CLIOptions arg)
+ *      Determine if the given arg is valid for creating installer.
+ *
  */
 class ValidOptions {
 
--- a/src/jdk.jpackage/share/classes/jdk/jpackage/internal/resources/HelpResources.properties	Thu Jun 06 19:14:02 2019 -0400
+++ b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/resources/HelpResources.properties	Thu Jun 06 19:18:09 2019 -0400
@@ -247,12 +247,12 @@
 \  --mac-sign\n\
 \          Request that the bundle be signed\n\
 \  --mac-signing-keychain <file path>\n\
-\          Path of the keychain to use\n\
-\          (absolute path or relative to the current directory)\n\
+\          Path of the keychain to search for the signing identity\n\
+\          (absolute path or relative to the current directory).\n\
 \          If not specified, the standard keychains are used.\n\
-\  --mac-signing-key-user-name <user name>\n\
-\          User name portion of the typical\n\
-\          "Mac Developer ID Application: <user name>" signing key\n\
+\  --mac-signing-key-user-name <team name>\n\
+\          Team name portion in Apple signing identities' names.\n\
+\          For example "Developer ID Application: "\n\
 
 MSG_Help_linux_install=\
 \  --linux-bundle-name <bundle name>\n\
--- a/src/jdk.jpackage/share/classes/jdk/jpackage/internal/resources/HelpResources_ja.properties	Thu Jun 06 19:14:02 2019 -0400
+++ b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/resources/HelpResources_ja.properties	Thu Jun 06 19:18:09 2019 -0400
@@ -247,12 +247,12 @@
 \  --mac-sign\n\
 \          Request that the bundle be signed\n\
 \  --mac-signing-keychain <file path>\n\
-\          Path of the keychain to use\n\
-\          (absolute path or relative to the current directory)\n\
+\          Path of the keychain to search for the signing identity\n\
+\          (absolute path or relative to the current directory).\n\
 \          If not specified, the standard keychains are used.\n\
-\  --mac-signing-key-user-name <user name>\n\
-\          User name portion of the typical\n\
-\          "Mac Developer ID Application: <user name>" signing key\n\
+\  --mac-signing-key-user-name <team name>\n\
+\          Team name portion in Apple signing identities' names.\n\
+\          For example "Developer ID Application: "\n\
 
 MSG_Help_linux_install=\
 \  --linux-bundle-name <bundle name>\n\
--- a/src/jdk.jpackage/share/classes/jdk/jpackage/internal/resources/HelpResources_zh_CN.properties	Thu Jun 06 19:14:02 2019 -0400
+++ b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/resources/HelpResources_zh_CN.properties	Thu Jun 06 19:18:09 2019 -0400
@@ -247,12 +247,12 @@
 \  --mac-sign\n\
 \          Request that the bundle be signed\n\
 \  --mac-signing-keychain <file path>\n\
-\          Path of the keychain to use\n\
-\          (absolute path or relative to the current directory)\n\
+\          Path of the keychain to search for the signing identity\n\
+\          (absolute path or relative to the current directory).\n\
 \          If not specified, the standard keychains are used.\n\
-\  --mac-signing-key-user-name <user name>\n\
-\          User name portion of the typical\n\
-\          "Mac Developer ID Application: <user name>" signing key\n\
+\  --mac-signing-key-user-name <team name>\n\
+\          Team name portion in Apple signing identities' names.\n\
+\          For example "Developer ID Application: "\n\
 
 MSG_Help_linux_install=\
 \  --linux-bundle-name <bundle name>\n\
--- a/src/jdk.jpackage/share/classes/jdk/jpackage/internal/resources/MainResources.properties	Thu Jun 06 19:14:02 2019 -0400
+++ b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/resources/MainResources.properties	Thu Jun 06 19:18:09 2019 -0400
@@ -62,7 +62,6 @@
 Advice to fix: {2}
 MSG_BundlerConfigExceptionNoAdvice=Bundler {0} skipped because of a configuration problem: {1}.
 MSG_BundlerRuntimeException=Bundler {0} failed because of {1}.
-MSG_Version=jpackage version
 MSG_BundlerFailed=Error: Bundler "{1}" ({0}) failed to produce a bundle.
 
 ERR_NoMainClass=Error: Main application class is missing.
--- a/src/jdk.jpackage/share/classes/jdk/jpackage/internal/resources/MainResources_ja.properties	Thu Jun 06 19:14:02 2019 -0400
+++ b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/resources/MainResources_ja.properties	Thu Jun 06 19:18:09 2019 -0400
@@ -35,8 +35,6 @@
 message.using-custom-resource-from-file=Using custom package resource {0} (loaded from file {1}).
 message.using-custom-resource=Using custom package resource {0} (loaded from {1}).
 message.creating-app-bundle=Creating app bundle: {0} in {1}.
-message.detected.modules=Automatically adding detected modules: {0}.
-message.modules=Adding modules: {0} to runtime image.
 message.app-image-dir-does-not-exist=Specified application image directory {0}: {1} does not exists.
 message.app-image-dir-does-not-exist.advice=Confirm that the value for {0} exists.
 message.runtime-image-dir-does-not-exist=Specified runtime image directory {0}: {1} does not exists.
@@ -64,7 +62,6 @@
 Advice to fix: {2}
 MSG_BundlerConfigExceptionNoAdvice=Bundler {0} skipped because of a configuration problem: {1}.
 MSG_BundlerRuntimeException=Bundler {0} failed because of {1}.
-MSG_Version=jpackage version
 MSG_BundlerFailed=Error: Bundler "{1}" ({0}) failed to produce a bundle.
 
 ERR_NoMainClass=Error: Main application class is missing.
--- a/src/jdk.jpackage/share/classes/jdk/jpackage/internal/resources/MainResources_zh_CN.properties	Thu Jun 06 19:14:02 2019 -0400
+++ b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/resources/MainResources_zh_CN.properties	Thu Jun 06 19:18:09 2019 -0400
@@ -35,8 +35,6 @@
 message.using-custom-resource-from-file=Using custom package resource {0} (loaded from file {1}).
 message.using-custom-resource=Using custom package resource {0} (loaded from {1}).
 message.creating-app-bundle=Creating app bundle: {0} in {1}.
-message.detected.modules=Automatically adding detected modules: {0}.
-message.modules=Adding modules: {0} to runtime image.
 message.app-image-dir-does-not-exist=Specified application image directory {0}: {1} does not exists.
 message.app-image-dir-does-not-exist.advice=Confirm that the value for {0} exists.
 message.runtime-image-dir-does-not-exist=Specified runtime image directory {0}: {1} does not exists.
@@ -64,7 +62,6 @@
 Advice to fix: {2}
 MSG_BundlerConfigExceptionNoAdvice=Bundler {0} skipped because of a configuration problem: {1}.
 MSG_BundlerRuntimeException=Bundler {0} failed because of {1}.
-MSG_Version=jpackage version
 MSG_BundlerFailed=Error: Bundler "{1}" ({0}) failed to produce a bundle.
 
 ERR_NoMainClass=Error: Main application class is missing.
--- a/src/jdk.jpackage/share/classes/jdk/jpackage/internal/resources/ResourceLocator.java	Thu Jun 06 19:14:02 2019 -0400
+++ b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/resources/ResourceLocator.java	Thu Jun 06 19:18:09 2019 -0400
@@ -25,6 +25,14 @@
 
 package jdk.jpackage.internal.resources;
 
-public class ResourceLocator {
+/*
+ * ResourceLocator
+ *     This empty class is the only class in this package. Otherwise the
+ * package consists only of resources. ResourceLocator is needed in order
+ * to call getResourceAsStream() to get those resources.
+ */
 
+public class ResourceLocator {
+    public ResourceLocator() {
+    }
 }
--- a/src/jdk.jpackage/share/classes/jdk/jpackage/main/Main.java	Thu Jun 06 19:14:02 2019 -0400
+++ b/src/jdk.jpackage/share/classes/jdk/jpackage/main/Main.java	Thu Jun 06 19:18:09 2019 -0400
@@ -3,7 +3,6 @@
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
  * published by the Free Software Foundation.  Oracle designates this
  * particular file as subject to the "Classpath" exception as provided
  * by Oracle in the LICENSE file that accompanied this code.
@@ -37,9 +36,6 @@
     private static final ResourceBundle bundle = ResourceBundle.getBundle(
             "jdk.jpackage.internal.resources.MainResources");
 
-    private static final String version = bundle.getString("MSG_Version")
-            + " " + System.getProperty("java.version");
-
     /**
      * main(String... args)
      * This is the entry point for the jpackage tool.
@@ -86,11 +82,11 @@
                 CLIHelp.showHelp(true);
             } else if (hasHelp(newArgs)){
                 if (hasVersion(newArgs)) {
-                    Log.info(version + "\n");
+                    Log.info(System.getProperty("java.version") + "\n");
                 }
                 CLIHelp.showHelp(false);
             } else if (hasVersion(newArgs)) {
-                Log.info(version);
+                Log.info(System.getProperty("java.version"));
             } else {
                 Arguments arguments = new Arguments(newArgs);
                 if (!arguments.processArguments()) {
--- a/src/jdk.jpackage/share/classes/module-info.java	Thu Jun 06 19:14:02 2019 -0400
+++ b/src/jdk.jpackage/share/classes/module-info.java	Thu Jun 06 19:18:09 2019 -0400
@@ -49,8 +49,6 @@
 module jdk.jpackage {
     requires jdk.jlink;
 
-    requires java.xml;
-    requires java.logging;
     requires java.desktop;
 
     uses jdk.jpackage.internal.Bundler;
--- a/test/jdk/tools/jpackage/JPackageVersionTest.java	Thu Jun 06 19:14:02 2019 -0400
+++ b/test/jdk/tools/jpackage/JPackageVersionTest.java	Thu Jun 06 19:18:09 2019 -0400
@@ -33,8 +33,7 @@
 public class JPackageVersionTest {
 
     private static final String ARG = "--version";
-    private static final String RESULT = "jpackage version"
-            + " " + System.getProperty("java.version");
+    private static final String RESULT = System.getProperty("java.version");
 
     private static void validate(String output) throws Exception {
         String[] result = output.split("\n");