- Clone the sample application and this repo.
- Build both the repo using going into the path and execute the command
mvn clean install
- Now you will get the jar files in the target. Copy the path of the
.jar
file in Example Application and Copy the path of the-dependencies.jar
file in JavaAgent. - First, run the application only with the Example Application using the command
$ java -jar <path of the packaged jar>
and observe the output.Hi I am main.
will be printed in the console. - Then run the application attached with the java agent using the command
$ java -javaagent:<path of agent jar file> -jar <path of the packaged jar file you want to intercept>
and observe the output.Logging using Agent
will be printed additionally in the console. This ensures that the java agent has been intercepted and added to the body of the main method.
-
Notifications
You must be signed in to change notification settings - Fork 3
Sathiyakugan/javaagent-example
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
This Repo contains the sample Java Agent that will intercept the main method of the Example class.
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published