equal
deleted
inserted
replaced
31 */ |
31 */ |
32 import java.lang.instrument.Instrumentation; |
32 import java.lang.instrument.Instrumentation; |
33 |
33 |
34 public class Agent { |
34 public class Agent { |
35 public static void premain(String options, Instrumentation ins) throws Exception { |
35 public static void premain(String options, Instrumentation ins) throws Exception { |
36 String bootclasspath = System.getProperty("sun.boot.class.path"); |
36 Class<?> c = Class.forName("AgentSupport"); |
37 System.out.println("bootclasspath: " + bootclasspath); |
|
38 |
|
39 Class c = Class.forName("AgentSupport"); |
|
40 ClassLoader cl = c.getClassLoader(); |
37 ClassLoader cl = c.getClassLoader(); |
41 if (cl != null) { |
38 if (cl != null) { |
42 System.err.println("AgentSupport loaded by: " + cl); |
39 System.err.println("AgentSupport loaded by: " + cl); |
43 throw new RuntimeException("AgentSupport class not loaded by boot class loader"); |
40 throw new RuntimeException("AgentSupport class not loaded by boot class loader"); |
44 } else { |
41 } else { |