< prev index next >

src/jdk.jpackage/share/classes/jdk/jpackage/internal/DeployParams.java

Print this page

        

@@ -110,19 +110,27 @@
         }
         resources.add(new RelativeFileSet(
                 baseDir, new LinkedHashSet<>(expandFileset(file))));
     }
 
-    void setClasspath() {
-        String classpath = "";
+    void setClasspath(String mainJarPath) {
+        String classpath;
+        // we want main jar first on the classpath
+        if (mainJarPath != null) {
+            classpath = mainJarPath + File.pathSeparator;
+        } else {
+            classpath = "";
+        }
         for (RelativeFileSet resource : resources) {
              for (String file : resource.getIncludedFiles()) {
                  if (file.endsWith(".jar")) {
+                     if (!file.equals(mainJarPath)) {
                      classpath += file + File.pathSeparator;
                  }
              }
         }
+        }
         addBundleArgument(
                 StandardBundlerParam.CLASSPATH.getID(), classpath);
     }
 
     static void validateName(String s, boolean forApp)
< prev index next >