equal
deleted
inserted
replaced
506 // |
506 // |
507 //Note we look for both JavaFX executable jars and regular executable jars |
507 //Note we look for both JavaFX executable jars and regular executable jars |
508 //As long as main "application" entry point is the same it is main class |
508 //As long as main "application" entry point is the same it is main class |
509 // (i.e. for FX jar we will use JavaFX manifest entry ...) |
509 // (i.e. for FX jar we will use JavaFX manifest entry ...) |
510 public String getMainApplicationJar() { |
510 public String getMainApplicationJar() { |
|
511 jdk.packager.internal.RelativeFileSet appResources = getAppResource(); |
511 if (mainJar != null) { |
512 if (mainJar != null) { |
|
513 if (getApplicationClass() == null) try { |
|
514 if (appResources != null) { |
|
515 File srcdir = appResources.getBaseDirectory(); |
|
516 JarFile jf = new JarFile(new File(srcdir, mainJar)); |
|
517 Manifest m = jf.getManifest(); |
|
518 Attributes attrs = (m != null) ? m.getMainAttributes() : null; |
|
519 if (attrs != null) { |
|
520 setApplicationClass( |
|
521 attrs.getValue(Attributes.Name.MAIN_CLASS)); |
|
522 } |
|
523 } |
|
524 } catch (IOException ignore) { |
|
525 } |
512 return mainJar; |
526 return mainJar; |
513 } |
527 } |
514 |
528 |
515 jdk.packager.internal.RelativeFileSet appResources = getAppResource(); |
|
516 String applicationClass = getApplicationClass(); |
529 String applicationClass = getApplicationClass(); |
517 |
530 |
518 if (appResources == null || applicationClass == null) { |
531 if (appResources == null || applicationClass == null) { |
519 return null; |
532 return null; |
520 } |
533 } |