cp = cp.replaceAll("\\s", "\\ ");
final String javaExecutable = getJavaExecutable();
getLog().debug("Java exectuable used: " + javaExecutable);
getLog().debug("Clojure classpath: " + cp);
CommandLine cl = null;
if (ExecutionMode.INTERACTIVE == executionMode && SystemUtils.IS_OS_WINDOWS && spawnInteractiveConsoleOnWindows) {
cl = new CommandLine("cmd");
cl.addArgument("/c");
cl.addArgument("start");
cl.addArgument(javaExecutable);
} else {
cl = new CommandLine(javaExecutable);
}
if (vmargs != null) {
cl.addArguments(vmargs, false);
}
cl.addArgument("-cp");
cl.addArgument(cp, false);
cl.addArgument("-Dclojure.compile.path=" + escapeFilePath(outputDirectory), false);
if (warnOnReflection) cl.addArgument("-Dclojure.compile.warn-on-reflection=true");
cl.addArguments(clojureOptions, false);
if (prependClasses != null) {
cl.addArguments(prependClasses.toArray(new String[prependClasses.size()]));
}
cl.addArgument(mainClass);
if (clojureArgs != null) {
cl.addArguments(clojureArgs, false);
}
getLog().debug("Command line: " + cl.toString());
Executor exec = new DefaultExecutor();
Map<String, String> env = new HashMap<String, String>(System.getenv());
// env.put("path", ";");
// env.put("path", System.getProperty("java.home"));