-
Notifications
You must be signed in to change notification settings - Fork 18
Home_EN
许杰 edited this page Sep 14, 2020
·
1 revision
- JDK[6,11]
- Linux/UNIX/MacOS / Windows
-
download source code which is a recent stable release.
-
modify the directory address of
copyfile.sh
-
execute the commands:
mvn clean install sh copyfile.sh
In Attach mode (dynamic injection), Easy-byte-coder depends on the jvm runtime environment variable, please make sure JAVA_HOME existed. Agent mode has no need for this setting.
Start in Attach mode:
java -Xbootclasspath/a:$JAVA_HOME/lib/tools.jar -jar bootstrap.jar
Next, select the process to inject:
If injection successes, you should see something like:
Attaching to target JVM with PID: 91420
Attached to target JVM and loaded Java agent successfully
If you need to modify JDK source codes, like injecting JDK methods, or making many modifications when starting, you can use Agent mode.
Start in Agent mode:
-javaagent:/Users/xujie/work/ymm/jar/agent.jar=plugins=systemtime.jar
├── zodiac-client
│ ├── agent agent main class, premain mothod
│ ├── client-bootstrap agent bootstrap,parameter parsing classLoader initialization,attach main class
│ ├── plugins for plugins,write codes about custom aop
│ ├── runtime-common-api runtime library, include ZodiacResource
│ └── traffic-handler core codes for executing byte-code injection
└── zodiac-common pom file