Skip to content

Latest commit

 

History

History
47 lines (34 loc) · 1.07 KB

README.md

File metadata and controls

47 lines (34 loc) · 1.07 KB

javaagent-base

Dependency

<dependency>
  <groupId>io.vproxy</groupId>
  <artifactId>javaagent-base</artifactId>
  <version>1.0.0</version>
</dependency>
implementation 'io.vproxy:javaagent-base:1.0.0'

How to use

Please refer to the sample project and modify-gradle-compiler-args project.

Notes:
You must --add-exports for both your module and io.vproxy.javaagent when compiling.
You should use shadowJar to bundle all classes into one fat jar and exclude module-info.class from the fat jar.

Sample

./gradlew clean shadowJar
jshell -R-javaagent:./sample/build/libs/biginteger-agent.jar

in the jshell:

jsehll> var a = new BigInteger("1")
a ==> 1000

Additional JVM Options

Add the following JVM options for the javaagent to work:

--add-opens java.base/jdk.internal.org.objectweb.asm=ALL-UNNAMED \
--add-opens java.base/jdk.internal.org.objectweb.asm.tree=ALL-UNNAMED