< prev index next >

src/jdk.jpackage/share/classes/jdk/jpackage/internal/AbstractImageBundler.java

Print this page

        

@@ -57,21 +57,10 @@
 
     public void imageBundleValidation(Map<String, ? super Object> p)
              throws ConfigException {
         StandardBundlerParam.validateMainClassInfoFromAppResources(p);
 
-        boolean hasMainJar = MAIN_JAR.fetchFrom(p) != null;
-        boolean hasMainModule =
-                StandardBundlerParam.MODULE.fetchFrom(p) != null;
-        boolean hasMainClass = MAIN_CLASS.fetchFrom(p) != null;
-        boolean runtime = RUNTIME_INSTALLER.fetchFrom(p);
-
-        if (!hasMainJar && !hasMainModule && !hasMainClass && !runtime) {
-            throw new ConfigException(
-                    I18N.getString("error.no-application-class"),
-                    I18N.getString("error.no-application-class.advice"));
-        }
     }
 
     public static void extractFlagsFromVersion(
             Map<String, ? super Object> params, String versionOutput) {
         Pattern bitArchPattern = Pattern.compile("(\\d*)[- ]?[bB]it");

@@ -119,12 +108,12 @@
             }
         }
     }
 
     protected File createRoot(Map<String, ? super Object> p,
-            File outputDirectory, boolean dependentTask,
-            String name, String jlinkKey) throws PackagerException {
+            File outputDirectory, boolean dependentTask, String name)
+            throws PackagerException {
         if (!outputDirectory.isDirectory() && !outputDirectory.mkdirs()) {
             throw new RuntimeException(MessageFormat.format(
                     I18N.getString("error.cannot-create-output-dir"),
                     outputDirectory.getAbsolutePath()));
         }

@@ -141,20 +130,14 @@
 
         // Create directory structure
         File rootDirectory = new File(outputDirectory, name);
 
         if (rootDirectory.exists()) {
-            if (!(OVERWRITE.fetchFrom(p))) {
-                throw new PackagerException("error.root-exists-without-overwrite",
+            throw new PackagerException("error.root-exists",
                         rootDirectory.getAbsolutePath());
             }
-            try {
-                IOUtils.deleteRecursive(rootDirectory);
-            } catch (IOException ioe) {
-                throw new PackagerException(ioe);
-            }
-        }
+
         rootDirectory.mkdirs();
 
         return rootDirectory;
     }
 
< prev index next >