The specified javaagent method is automatically loaded when the JVM is started by accident when checking the data
The core is the JAVA_TOOL_OPTIONS
variable
Linux
export JAVA_TOOL_OPTIONS=-javaagent:/test.jar
Windows
set JAVA_TOOL_OPTIONS=-javaagent:D:/test.jar
It is recommended to set it to the environment variable, cooperate AspectJ
, can construct a big killer.
When the JVM detects that there is a setting at startup JAVA_TOOL_OPTIONS
, it will automatically JAVA_TOOL_OPTIONS
load the value as the JVM startup parameter
Reference: https://docs.oracle.com/javase/8/docs/technotes/guides/troubleshoot/envvars002.html