1 4 package com.tc.aspectwerkz.hook; 5 6 13 public class BootClasspathStarter extends AbstractStarter { 14 private String bootDir; 15 16 public BootClasspathStarter(String opt, String main, String bootDir) { 17 super(opt, main); 18 this.bootDir = bootDir; 19 patchBootclasspath(); 20 } 21 22 25 private void patchBootclasspath() { 26 if (opt.indexOf("-Xbootclasspath/p:") < 0) { 28 opt = "-Xbootclasspath/p:\"" + bootDir + "\" " + opt; 29 30 } else { 32 int index = -1; 33 if (opt.indexOf("-Xbootclasspath/p:\"") >= 0) { 34 index = opt.indexOf("-Xbootclasspath/p:\"") + "-Xbootclasspath/p:\"".length(); 36 } else if (opt.indexOf("-Xbootclasspath/p:'") >= 0) { 37 index = opt.indexOf("-Xbootclasspath/p:'") + "-Xbootclasspath/p:'".length(); 39 } else { 40 index = opt.indexOf("-Xbootclasspath/p:") + "-Xbootclasspath/p:".length(); 42 } 43 StringBuffer optB = new StringBuffer (""); 44 optB.append(opt.substring(0, index)); 45 optB.append(bootDir); 46 optB.append((System.getProperty("os.name", "").toLowerCase().indexOf("windows") >= 0) ? ";" : ":"); 47 optB.append(opt.substring(index)); 48 opt = optB.toString(); 49 } 50 } 51 } | Popular Tags |