src/share/classes/sun/launcher/LauncherHelper.java
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File jdk Cdiff src/share/classes/sun/launcher/LauncherHelper.java

src/share/classes/sun/launcher/LauncherHelper.java

Print this page

        

*** 63,76 **** --- 63,80 ---- import java.util.Set; import java.util.TreeSet; import java.util.jar.Attributes; import java.util.jar.JarFile; import java.util.jar.Manifest; + import sun.misc.Version; + import sun.misc.URLClassPath; public enum LauncherHelper { INSTANCE; private static final String MAIN_CLASS = "Main-Class"; + private static final String PROFILE = "Profile"; + private static StringBuilder outBuf = new StringBuilder(); private static final String INDENT = " "; private static final String VM_SETTINGS = "VM settings:"; private static final String PROP_SETTINGS = "Property settings:";
*** 416,425 **** --- 420,451 ---- */ if (mainAttrs.containsKey( new Attributes.Name(FXHelper.JAVAFX_APPLICATION_MARKER))) { return FXHelper.class.getName(); } + + /* + * If this is not a full JRE then the Profile attribute must be + * present with the Main-Class attribute so as to indicate the minimum + * profile required. Note that we need to suppress checking of the Profile + * attribute after we detect an error. This is because the abort may + * need to lookup resources and this may involve opening additional JAR + * files that would result in errors that suppress the main error. + */ + String profile = mainAttrs.getValue(PROFILE); + if (profile == null) { + if (!Version.isFullJre()) { + URLClassPath.suppressProfileCheckForLauncher(); + abort(null, "java.launcher.jar.error4", jarname); + } + } else { + if (!Version.supportsProfile(profile)) { + URLClassPath.suppressProfileCheckForLauncher(); + abort(null, "java.launcher.jar.error5", profile, jarname); + } + } + return mainValue.trim(); } catch (IOException ioe) { abort(ioe, "java.launcher.jar.error1", jarname); } return null;
src/share/classes/sun/launcher/LauncherHelper.java
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File