This content has been marked as final. Show 3 replies
It should not call twice. And I do not see how it can happen. If you
provide more information like how you called jni CreateJavaVm
would help to find out.
I have many layers of architecture and a facility which handles parsing Java options on the behalf of my JNI applications. The agentpath option was getting set twice causing my agents to run twice. It has been my experience that the last Java option passed into the JVM overrides any prior instances of that particular option. I guess this is not true for agentlib or agentpath.
Hopefully tomorrow I'll find out that this conflict was the root cause of my JNI function Intercept issue I posted about earlier.
There can be multiple -javaagent, -agentlib, -agentpath options on the command line as there may be multiple agents.