1 4 package com.tc.aspectwerkz.hook; 5 6 import java.io.File ; 7 import java.io.IOException ; 8 9 15 abstract class AbstractStarter { 16 protected String opt; 17 18 protected String main; 19 20 protected AbstractStarter(String opt, String main) { 21 this.opt = opt; 22 this.main = main; 23 } 24 25 28 public String getCommandLine() { 29 StringBuffer command = new StringBuffer (); 30 command.append(System.getProperty("java.home")); 31 command.append(File.separatorChar).append("bin").append(File.separatorChar).append("java"); 32 command.append(" ").append(opt); 33 command.append(" ").append(main); 34 return command.toString(); 35 } 36 37 40 public Process launchVM() throws IOException { 41 System.out.println(getCommandLine()); 42 return Runtime.getRuntime().exec(getCommandLine()); 43 } 44 } | Popular Tags |