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

Print this page

        

@@ -354,15 +354,29 @@
 
     public List<String> getArguments() {
         return ARGUMENTS.fetchFrom(params);
     }
 
-    //Validation approach:
+    // Validation approach:
+    //  - javac and
+    //
+    //  - /jmods dir
+    // or
     //  - JRE marker (rt.jar)
     //  - FX marker (jfxrt.jar)
     //  - JDK marker (tools.jar)
     private static boolean checkJDKRoot(File jdkRoot) {
+        File javac = new File(jdkRoot, "bin/javac");
+        File javacexe = new File(jdkRoot, "bin/javac.exe");
+        if (!javac.exists() && !javacexe.exists()) {
+            Log.verbose("javac is not found at " + javac.getAbsolutePath());
+            return false;
+        }
+
+        File jmods = new File(jdkRoot, "jmods");
+        if (!jmods.exists()) {
+            // old non-modular JDKs
         File rtJar = new File(jdkRoot, "jre/lib/rt.jar");
         if (!rtJar.exists()) {
             Log.verbose("rt.jar is not found at " + rtJar.getAbsolutePath());
             return false;
         }

@@ -381,11 +395,11 @@
         File toolsJar = new File(jdkRoot, "lib/tools.jar");
         if (!toolsJar.exists()) {
             Log.verbose("tools.jar is not found at " + toolsJar.getAbsolutePath());
             return false;
         }
-
+        }
         return true;
     }
 
     //Depending on platform and user input we may get different "references"
     //Should support