<dependency>
<groupId>io.vproxy</groupId>
<artifactId>javaagent-base</artifactId>
<version>1.0.0</version>
</dependency>
implementation 'io.vproxy:javaagent-base:1.0.0'
Please refer to the sample project and modify-gradle-compiler-args project.
Notes:
You must--add-exports
for both your module andio.vproxy.javaagent
when compiling.
You should useshadowJar
to bundle all classes into one fat jar and excludemodule-info.class
from the fat jar.
./gradlew clean shadowJar
jshell -R-javaagent:./sample/build/libs/biginteger-agent.jar
in the jshell:
jsehll> var a = new BigInteger("1")
a ==> 1000
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