< prev index next >
src/jdk.jpackage/share/classes/jdk/jpackage/internal/AbstractImageBundler.java
Print this page
*** 57,77 ****
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");
--- 57,66 ----
*** 119,130 ****
}
}
}
protected File createRoot(Map<String, ? super Object> p,
! File outputDirectory, boolean dependentTask,
! String name, String jlinkKey) throws PackagerException {
if (!outputDirectory.isDirectory() && !outputDirectory.mkdirs()) {
throw new RuntimeException(MessageFormat.format(
I18N.getString("error.cannot-create-output-dir"),
outputDirectory.getAbsolutePath()));
}
--- 108,119 ----
}
}
}
protected File createRoot(Map<String, ? super Object> p,
! 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,160 ****
// Create directory structure
File rootDirectory = new File(outputDirectory, name);
if (rootDirectory.exists()) {
! if (!(OVERWRITE.fetchFrom(p))) {
! throw new PackagerException("error.root-exists-without-overwrite",
rootDirectory.getAbsolutePath());
}
! try {
! IOUtils.deleteRecursive(rootDirectory);
! } catch (IOException ioe) {
! throw new PackagerException(ioe);
! }
! }
rootDirectory.mkdirs();
return rootDirectory;
}
--- 130,143 ----
// Create directory structure
File rootDirectory = new File(outputDirectory, name);
if (rootDirectory.exists()) {
! throw new PackagerException("error.root-exists",
rootDirectory.getAbsolutePath());
}
!
rootDirectory.mkdirs();
return rootDirectory;
}
< prev index next >