Skip to content

javaaggent demo - use javaagent and javassist to enhance bytecode

Notifications You must be signed in to change notification settings

denghuanqing/agent-demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 

Repository files navigation

agent-demo

javaaggent demo - use javaagent and javassist to enhance bytecode

how to use

run before application

1.update pom.xml

<Premain-Class>com.poppy.premain.AgentDemo</Premain-Class>

2.package

mvn clean install

3.set agent

java -javaagent:E:\github_code\agent-demo\target\agent-demo-1.0-SNAPSHOT.jar -jar ***.jar

run in application running

1.update pom.xml

<Agent-Class>com.poppy.agentmain.AgentmainAgent</Agent-Class>

2.package

mvn clean install

3.run target and dynamic attach

run com.poppy.agentmain.AgentTargetSample#main()
run com.poppy.agentmain.AgentmainAttachMain#main()

reference

instrumentation 功能介绍

Javassist中文技术文档

About

javaaggent demo - use javaagent and javassist to enhance bytecode

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages