I should connect to a java program on localhost jvm using JMX. In other words I want to develop a JMX client to config a java program on localhost.
Don\'t r
To clarify, if you are only interested in getting local JMX stats, you don't need to use the remote api. Just use java.lang.management.ManagementFactory:
MemoryMXBean memoryMXBean = ManagementFactory.getMemoryMXBean();
memoryMXBean.getHeapMemoryUsage().getMax();
...
List beans = ManagementFactory.getMemoryPoolMXBeans();
...