How to configure JVM Argument -javaagent with two jars

Narendra Verma picture Narendra Verma · Nov 28, 2013 · Viewed 10.1k times · Source

To use the spring AOP, I have to configure -javaagent:C:/spring-agent-2.5.6.jar as JVM argument. But there is a jar that is already configured i.e. -javaagent:C:/other.jar

Now how can I configure both jars with -javaagent so that both jars should work properly?

Also there may be the different approaches to configure multiple jars with -javaagent in Windows and Linux environment. Please suggest the solution for both of the environments.

Answer

vladimir e. picture vladimir e. · Nov 28, 2013

One java application may have any number of agents by using -javaagent: option any number of times. Agents are invoked in the same order as specified in options