Adding javaagent to process id or JVM start up

眉间皱痕 提交于 2019-12-24 00:48:53

问题


I want to add a java agent to process ID of the already running java application. Is there any way doing that using command line, something like

java -jar java agent.jar process_id

or if i can edit the hotspot JVM start up script directly to add the java agent there itself, but how can i edit the hotspot JVM start up script. I am using UNIX.


回答1:


If you are working with the sun JVM you can use the dynamic attach agent.

http://docs.oracle.com/javase/7/docs/technotes/guides/attach/index.html



来源:https://stackoverflow.com/questions/25479268/adding-javaagent-to-process-id-or-jvm-start-up

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!