636 boolean hasMainJarClassPath = params.containsKey(CLASSPATH.getID()); |
634 boolean hasMainJarClassPath = params.containsKey(CLASSPATH.getID()); |
637 boolean hasModule = params.containsKey(MODULE.getID()); |
635 boolean hasModule = params.containsKey(MODULE.getID()); |
638 boolean hasAppImage = params.containsKey(PREDEFINED_APP_IMAGE.getID()); |
636 boolean hasAppImage = params.containsKey(PREDEFINED_APP_IMAGE.getID()); |
639 |
637 |
640 if (hasMainClass && hasMainJar && hasMainJarClassPath || |
638 if (hasMainClass && hasMainJar && hasMainJarClassPath || |
641 hasModule || hasAppImage || isRuntimeInstaller(params)) { |
639 hasAppImage || isRuntimeInstaller(params)) { |
642 return; |
640 return; |
643 } |
641 } |
644 |
642 if (hasModule) { |
645 extractMainClassInfoFromAppResources(params); |
643 if (JLinkBundlerHelper.getMainClassFromModule(params) == null) { |
646 |
|
647 if (!params.containsKey(MAIN_CLASS.getID())) { |
|
648 if (hasMainJar) { |
|
649 throw new ConfigException( |
644 throw new ConfigException( |
650 MessageFormat.format(I18N.getString( |
645 I18N.getString("ERR_NoMainClass"), null); |
651 "error.no-main-class-with-main-jar"), |
646 } |
652 MAIN_JAR.fetchFrom(params)), |
647 } else { |
653 MessageFormat.format(I18N.getString( |
648 extractMainClassInfoFromAppResources(params); |
654 "error.no-main-class-with-main-jar.advice"), |
649 |
655 MAIN_JAR.fetchFrom(params))); |
650 if (!params.containsKey(MAIN_CLASS.getID())) { |
656 } else { |
651 if (hasMainJar) { |
657 throw new ConfigException( |
652 throw new ConfigException( |
658 I18N.getString("error.no-main-class"), |
653 MessageFormat.format(I18N.getString( |
659 I18N.getString("error.no-main-class.advice")); |
654 "error.no-main-class-with-main-jar"), |
|
655 MAIN_JAR.fetchFrom(params)), |
|
656 MessageFormat.format(I18N.getString( |
|
657 "error.no-main-class-with-main-jar.advice"), |
|
658 MAIN_JAR.fetchFrom(params))); |
|
659 } else { |
|
660 throw new ConfigException( |
|
661 I18N.getString("error.no-main-class"), |
|
662 I18N.getString("error.no-main-class.advice")); |
|
663 } |
660 } |
664 } |
661 } |
665 } |
662 } |
666 } |
663 |
667 |
664 private static List<RelativeFileSet> |
668 private static List<RelativeFileSet> |