0
我是儀表世界的新手。 我想在運行系統中運行遠程JVM。 其實,我有記錄所有類別或其中一部分,改造他們.. 我看了很多文件,我發現這個代碼HERE遠程運行時間儀表
我改變了代碼,我該換成
// Run sayHello in a loop
Person person = new Person();
for(int i = 0; i < 1000; i++) {
person.sayHello(i);
person.sayHello("" + (i*-1));
Thread.currentThread().join(5000);
}
之一:
for (int i = 1; i < args.length; i++) {
String className = args[i] ;
System.out.println("className" + className);
// Call transformClass on the transformer MBean
server.invoke(on, "transformClass", new Object[]{className}, new String[]{String.class.getName()});
}
但我發現args.length = 0 我不知道什麼是ARGS []包含...如果它包含加載的類(我假設),那麼它爲什麼是空的..
請幫忙嗎?
日Thnx @Nicholas ......它完成;) 但我要問你的其他問題:與在github你的代碼,我能儀表類女巫locatedIn屬性另一個應用程序? – GEmyy
@GEmyy;對。這是主意。將代理安裝到目標應用程序中,然後對其進行測試。 – Nicholas
thnx @Nicholas,但我該如何安裝代理到目標應用程序? 「AgentInstaller」類存在於我的程序中但是我想陳述另一個應用程序..我應該只更改AgentInstaller類中的PID還是什麼? – GEmyy