1 8 package org.codehaus.aspectwerkz.hook; 9 10 17 public class BootClasspathStarter extends AbstractStarter { 18 private String bootDir; 19 20 public BootClasspathStarter(String opt, String main, String bootDir) { 21 super(opt, main); 22 this.bootDir = bootDir; 23 patchBootclasspath(); 24 } 25 26 29 private void patchBootclasspath() { 30 if (opt.indexOf("-Xbootclasspath/p:") < 0) { 32 opt = "-Xbootclasspath/p:\"" + bootDir + "\" " + opt; 33 34 } else { 36 int index = -1; 37 if (opt.indexOf("-Xbootclasspath/p:\"") >= 0) { 38 index = opt.indexOf("-Xbootclasspath/p:\"") + "-Xbootclasspath/p:\"".length(); 40 } else if (opt.indexOf("-Xbootclasspath/p:'") >= 0) { 41 index = opt.indexOf("-Xbootclasspath/p:'") + "-Xbootclasspath/p:'".length(); 43 } else { 44 index = opt.indexOf("-Xbootclasspath/p:") + "-Xbootclasspath/p:".length(); 46 } 47 StringBuffer optB = new StringBuffer (""); 48 optB.append(opt.substring(0, index)); 49 optB.append(bootDir); 50 optB.append((System.getProperty("os.name", "").toLowerCase().indexOf("windows") >= 0) ? ";" : ":"); 51 optB.append(opt.substring(index)); 52 opt = optB.toString(); 53 } 54 } 55 } | Popular Tags |