modules/jdk.packager/src/main/java/com/sun/javafx/tools/packager/bundlers/BundleParams.java

Print this page




 339     public boolean getVerbose() {
 340         return fetchParam(VERBOSE);
 341     }
 342 
 343     public void setVerbose(Boolean verbose) {
 344         putUnlessNull(VERBOSE.getID(), verbose);
 345     }
 346 
 347     public List<String> getLicenseFile() {
 348         return fetchParam(LICENSE_FILE);
 349     }
 350 
 351     public List<String> getJvmargs() {
 352         return JVM_OPTIONS.fetchFrom(params);
 353     }
 354 
 355     public List<String> getArguments() {
 356         return ARGUMENTS.fetchFrom(params);
 357     }
 358 
 359     //Validation approach:




 360     //  - JRE marker (rt.jar)
 361     //  - FX marker (jfxrt.jar)
 362     //  - JDK marker (tools.jar)
 363     private static boolean checkJDKRoot(File jdkRoot) {










 364         File rtJar = new File(jdkRoot, "jre/lib/rt.jar");
 365         if (!rtJar.exists()) {
 366             Log.verbose("rt.jar is not found at " + rtJar.getAbsolutePath());
 367             return false;
 368         }
 369 
 370         File jfxJar = new File(jdkRoot, "jre/lib/ext/jfxrt.jar");
 371         if (!jfxJar.exists()) {
 372             //Try again with new location
 373             jfxJar = new File(jdkRoot, "jre/lib/jfxrt.jar");
 374             if (!jfxJar.exists()) {
 375                 Log.verbose("jfxrt.jar is not found at " + jfxJar.getAbsolutePath());
 376                 return false;
 377             }
 378         }
 379 
 380 
 381         File toolsJar = new File(jdkRoot, "lib/tools.jar");
 382         if (!toolsJar.exists()) {
 383             Log.verbose("tools.jar is not found at " + toolsJar.getAbsolutePath());
 384             return false;
 385         }
 386 
 387         return true;
 388     }
 389 
 390     //Depending on platform and user input we may get different "references"
 391     //Should support
 392     //   - java.home
 393     //   - reference to JDK install folder
 394     //   - should NOT support JRE dir
 395     //Note: input could be null (then we asked to use system JRE)
 396     //       or it must be valid directory
 397     //Returns null on validation failure. Returns jre root if ok.
 398     public static File validateRuntimeLocation(File javaHome) {
 399         if (javaHome == null) {
 400             return null;
 401         }
 402 
 403         File jdkRoot;
 404         File rtJar = new File(javaHome, "lib/rt.jar");
 405 
 406         if (rtJar.exists()) { //must be "java.home" case




 339     public boolean getVerbose() {
 340         return fetchParam(VERBOSE);
 341     }
 342 
 343     public void setVerbose(Boolean verbose) {
 344         putUnlessNull(VERBOSE.getID(), verbose);
 345     }
 346 
 347     public List<String> getLicenseFile() {
 348         return fetchParam(LICENSE_FILE);
 349     }
 350 
 351     public List<String> getJvmargs() {
 352         return JVM_OPTIONS.fetchFrom(params);
 353     }
 354 
 355     public List<String> getArguments() {
 356         return ARGUMENTS.fetchFrom(params);
 357     }
 358 
 359     // Validation approach:
 360     //  - javac and
 361     //
 362     //  - /jmods dir
 363     // or
 364     //  - JRE marker (rt.jar)
 365     //  - FX marker (jfxrt.jar)
 366     //  - JDK marker (tools.jar)
 367     private static boolean checkJDKRoot(File jdkRoot) {
 368         File javac = new File(jdkRoot, "bin/javac");
 369         File javacexe = new File(jdkRoot, "bin/javac.exe");
 370         if (!javac.exists() && !javacexe.exists()) {
 371             Log.verbose("javac is not found at " + javac.getAbsolutePath());
 372             return false;
 373         }
 374 
 375         File jmods = new File(jdkRoot, "jmods");
 376         if (!jmods.exists()) {
 377             // old non-modular JDKs
 378             File rtJar = new File(jdkRoot, "jre/lib/rt.jar");
 379             if (!rtJar.exists()) {
 380                 Log.verbose("rt.jar is not found at " + rtJar.getAbsolutePath());
 381                 return false;
 382             }
 383 
 384             File jfxJar = new File(jdkRoot, "jre/lib/ext/jfxrt.jar");
 385             if (!jfxJar.exists()) {
 386                 //Try again with new location
 387                 jfxJar = new File(jdkRoot, "jre/lib/jfxrt.jar");
 388                 if (!jfxJar.exists()) {
 389                     Log.verbose("jfxrt.jar is not found at " + jfxJar.getAbsolutePath());
 390                     return false;
 391                 }
 392             }
 393 
 394 
 395             File toolsJar = new File(jdkRoot, "lib/tools.jar");
 396             if (!toolsJar.exists()) {
 397                 Log.verbose("tools.jar is not found at " + toolsJar.getAbsolutePath());
 398                 return false;
 399             }
 400         }
 401         return true;
 402     }
 403 
 404     //Depending on platform and user input we may get different "references"
 405     //Should support
 406     //   - java.home
 407     //   - reference to JDK install folder
 408     //   - should NOT support JRE dir
 409     //Note: input could be null (then we asked to use system JRE)
 410     //       or it must be valid directory
 411     //Returns null on validation failure. Returns jre root if ok.
 412     public static File validateRuntimeLocation(File javaHome) {
 413         if (javaHome == null) {
 414             return null;
 415         }
 416 
 417         File jdkRoot;
 418         File rtJar = new File(javaHome, "lib/rt.jar");
 419 
 420         if (rtJar.exists()) { //must be "java.home" case