0

I want to load a Java agent at runtime without Restarting the JVM I know that I can load the agent with the -javaagent argument when starting the JVM but I want to do it at runtime.

I found out that is possible using Sun tools but when I tried to do that in C++ and JNI it doesn't work and it can't find the required Java functions.

Botje
  • 26,269
  • 3
  • 31
  • 41
NightmareXD
  • 425
  • 1
  • 4
  • 14
  • 1
    [jattach](https://github.com/jattach/jattach/) project (written in C) does exactly that. – apangin Aug 08 '23 at 09:17
  • @apangin I tried that but it doesn't seems to be working it returns: Connected to remote process Response code = 0 return code: 100 and the agent is also not loaded – NightmareXD Aug 08 '23 at 16:55
  • This is an issue with the agent: perhaps, it does not export `Agent_OnAttach`, or the required dependency is missing. – apangin Aug 08 '23 at 19:00

0 Answers0