src/jdk.packager/share/classes/jdk/packager/internal/Arguments.java
branchJDK-8200758-branch
changeset 56882 0ec8559f599a
parent 56869 41e17fe9fbeb
child 56933 9f59eeb3cc0f
equal deleted inserted replaced
56870:6668bbc41155 56882:0ec8559f599a
   112 
   112 
   113     private boolean hasMainJar = false;
   113     private boolean hasMainJar = false;
   114     private boolean hasMainClass = false;
   114     private boolean hasMainClass = false;
   115     private boolean hasMainModule = false;
   115     private boolean hasMainModule = false;
   116     private boolean hasTargetFormat = false;
   116     private boolean hasTargetFormat = false;
       
   117     private boolean hasAppImage = false;
   117 
   118 
   118     private String mainJarPath = null;
   119     private String mainJarPath = null;
   119     
   120     
   120     private static boolean echo = false;
   121     private static boolean echo = false;
   121     private static boolean verbose = false;
   122     private static boolean verbose = false;
   303         ECHO_MODE ("echo-mode", OptionCategories.PROPERTY, () -> {
   304         ECHO_MODE ("echo-mode", OptionCategories.PROPERTY, () -> {
   304             echo = true;
   305             echo = true;
   305             setOptionValue("echo-mode", true);
   306             setOptionValue("echo-mode", true);
   306         }),
   307         }),
   307 
   308 
   308         PREDEFINED_APP_IMAGE ("app-image", OptionCategories.PROPERTY),
   309         PREDEFINED_APP_IMAGE ("app-image", OptionCategories.PROPERTY, ()-> {
       
   310             setOptionValue("app-image", popArg());
       
   311             context().hasAppImage = true;
       
   312         }),
   309         
   313         
   310         PREDEFINED_RUNTIME_IMAGE ("runtime-image", OptionCategories.PROPERTY),
   314         PREDEFINED_RUNTIME_IMAGE ("runtime-image", OptionCategories.PROPERTY),
   311 
   315 
   312         MAIN_JAR ("main-jar", "j", OptionCategories.PROPERTY, () -> {
   316         MAIN_JAR ("main-jar", "j", OptionCategories.PROPERTY, () -> {
   313             context().mainJarPath = popArg();
   317             context().mainJarPath = popArg();
   534                 // first argument should always be a mode.
   538                 // first argument should always be a mode.
   535                 Log.info("ERROR: Mode is not specified");
   539                 Log.info("ERROR: Mode is not specified");
   536                 return false;
   540                 return false;
   537             }
   541             }
   538 
   542 
   539             if (!hasMainJar && !hasMainModule &&
   543             if (!hasAppImage && !hasMainJar && !hasMainModule &&
   540                     !hasMainClass && !jreInstaller) {
   544                     !hasMainClass && !jreInstaller) {
   541                 Log.info("ERROR: Main jar or main class or main module "
   545                 Log.info("ERROR: Main jar, main class, main module, or app-image "
   542                         + "must be specified.");
   546                         + "must be specified.");
   543             } else if (!hasMainModule && !hasMainClass) {
   547             } else if (!hasMainModule && !hasMainClass) {
   544                 // try to get main-class from manifest
   548                 // try to get main-class from manifest
   545                 String mainClass = getMainClassFromManifest();
   549                 String mainClass = getMainClassFromManifest();
   546                 if (mainClass != null) {
   550                 if (mainClass != null) {