compose command line according to isabelle.shell/home system properties;
authorwenzelm
Sat, 15 Dec 2007 23:54:59 +0100
changeset 25658 c3ae6c345fb5
parent 25657 9f7796a02b28
child 25659 ef84226f9488
compose command line according to isabelle.shell/home system properties;
lib/classes/isabelle/IsabelleProcess.java
--- a/lib/classes/isabelle/IsabelleProcess.java	Sat Dec 15 23:54:10 2007 +0100
+++ b/lib/classes/isabelle/IsabelleProcess.java	Sat Dec 15 23:54:59 2007 +0100
@@ -20,6 +20,7 @@
 package isabelle;
 
 import java.io.*;
+import java.util.ArrayList;
 import java.util.Locale;
 import java.util.concurrent.LinkedBlockingQueue;
 
@@ -344,10 +345,30 @@
 
     public IsabelleProcess(String logic) throws IsabelleProcessException
     {
-        String [] cmdline = {"bash", "isabelle-process", "-W", logic};
+        ArrayList<String> cmdline = new ArrayList<String> ();
+        String shell = null;
+        String home = null;
         String charset = "UTF-8";
+        
+        shell = System.getProperty("isabelle.shell");
+        home = System.getProperty("isabelle.home");
+        if (shell != null && home != null) {
+            cmdline.add(shell);
+            cmdline.add(home +  "/bin/isabelle-process");
+        } else if (home != null) {
+            cmdline.add(home +  "/bin/isabelle-process");            
+        } else if (shell != null) {
+            throw new IsabelleProcessException("Cannot start process: isabelle.shell property requires isabelle.home");
+        } else {
+            cmdline.add("isabelle-process");
+        }
+        cmdline.add("-W");
+        cmdline.add(logic);
+
         try {
-            proc = Runtime.getRuntime().exec(cmdline);
+            String [] cmd = new String[cmdline.size()];
+            cmdline.toArray(cmd);
+            proc = Runtime.getRuntime().exec(cmd);
         } catch (IOException exn) {
             throw new IsabelleProcessException(exn.getMessage());
         }