0

I need to access the VM arguements from the VM summary tab on jconsole programmatically.. i.e using java.

Am using JMX to create connection to a remote server. using method

MBeanServerConnection connection = JMXConnector.getMBeanServerConnection();

When I used Jconcole to monitor the jmx connection, there is a lot of information on VM summary tab. I need the VM arguements particularly to use in my program.

Please guide !!

user3457017
  • 55
  • 1
  • 6

1 Answers1

0

I got the answer to the question. In case someone needs it.. Use this code:

ObjectName objName = new ObjectName(ManagementFactory.RUNTIME_MXBEAN_NAME); String[] vendor = (String[]) mbsc.getAttribute(objName, "InputArguments");

This will return array of strings that contains vm arguments. you can pass different paramenters to query the RuntimeMxBean.

user3457017
  • 55
  • 1
  • 6