JAL-3065 don’t quote class path args for Runtime.exec java launch command (needs...
[jalview.git] / test / jalview / bin / CommandLineOperations.java
index 69a3ef7..d586dae 100644 (file)
@@ -55,7 +55,7 @@ public class CommandLineOperations
 
   private static final int MINFILESIZE_BIG = 4096;
 
-  private ArrayList<String> successfulCMDs = new ArrayList<String>();
+  private ArrayList<String> successfulCMDs = new ArrayList<>();
 
   /***
    * from
@@ -116,9 +116,17 @@ public class CommandLineOperations
   private Worker jalviewDesktopRunner(boolean withAwt, String cmd,
           int timeout)
   {
+    String cp_sep = ":";
+    if (System.getProperty("os.name").indexOf("Windows") >= 0)
+    {
+      cp_sep = ";";
+    }
+    // Note: JAL-3065 - don't include quotes for lib/* because the arguments are
+    // not expanded by the shell
     String _cmd = "java "
             + (withAwt ? "-Djava.awt.headless=true" : "")
-            + " -Djava.ext.dirs=./lib -classpath ./classes jalview.bin.Jalview ";
+            + " -classpath ./classes" + cp_sep
+            + "./lib/* jalview.bin.Jalview ";
     System.out.println("CMD [" + cmd + "]");
     Process ls2_proc = null;
     Worker worker = null;