How to use VisualVM and JMX?

Start your service using these options:

-Djava.rmi.server.hostname=193.163.XXX.XXX
-Dcom.sun.management.jmxremote 
-Dcom.sun.management.jmxremote.port=9199 
-Dcom.sun.management.jmxremote.authenticate=false 
-Dcom.sun.management.jmxremote.ssl=false

Then you can use jvisualvm or jconsole with just the "193.163.XXX.XXX:9199" address.


Follow the below steps.
1) Go to remote machine open X11 forwarding,
2) Installed XMING in windows
3) Start visual VM in Remote machine the GUI will come in your windows xming.
4) Instead of IP use localhost and use same port number.

If above steps not working it means something is wrong with configuration.
If above steps working fine then go to iptables and ensure port 9199 open for outer world. as well start the program with java -Djava.rmi.server.hostname=YOUR_IP

For more details refer this link