System.setProperty("openejb.home", distribOutput.getAbsolutePath());
System.setProperty("server.shutdown.port", parser.stop());
System.setProperty("server.shutdown.command", config.getProperty("shutdownCommand"));
final RemoteServer server = new RemoteServer();
server.setPortStartup(Integer.parseInt(parser.http()));
if (config.containsKey("additionalClasspath")) {
server.setAdditionalClasspath(config.getProperty("additionalClasspath"));
}
final List<String> jvmArgs = new LinkedList<String>();
if (additionalArgs != null) {
Collections.addAll(jvmArgs, additionalArgs.split(" "));
}
for (final String k : config.stringPropertyNames()) {
if (k.startsWith("jvmArg.")) {
jvmArgs.add(config.getProperty(k));
}
}
if ("run".equals(args[0])) {
args[0] = "start";
}
server.start(jvmArgs, args[0], true);
server.getServer().waitFor();
} else {
params.add(cmd);
params.addAll(asList(args));
final ProcessBuilder builder = new ProcessBuilder(params.toArray(new String[params.size()])).directory(distribOutput);