1 8 package org.codehaus.aspectwerkz.hook; 9 10 import java.io.File ; 11 import java.io.IOException ; 12 13 19 abstract class AbstractStarter { 20 protected String opt; 21 22 protected String main; 23 24 protected AbstractStarter(String opt, String main) { 25 this.opt = opt; 26 this.main = main; 27 } 28 29 32 public String getCommandLine() { 33 StringBuffer command = new StringBuffer (); 34 command.append(System.getProperty("java.home")); 35 command.append(File.separatorChar).append("bin").append(File.separatorChar).append("java"); 36 command.append(" ").append(opt); 37 command.append(" ").append(main); 38 return command.toString(); 39 } 40 41 44 public Process launchVM() throws IOException { 45 System.out.println(getCommandLine()); 46 return Runtime.getRuntime().exec(getCommandLine()); 47 } 48 } | Popular Tags |