Home >Java >javaTutorial >How do I enable remote JMX access to a JVM using JConsole?
Activating JMX on JVM for Access via JConsole
To enable remote JMX access to a Java Virtual Machine (JVM), you need to activate JMX and set appropriate command-line arguments. Here's how you can do it:
Refer to the official documentation at http://java.sun.com/javase/6/docs/technotes/guides/management/agent.html for full details.
Command-Line Arguments:
Start your JVM with the following parameters:
-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=9010 -Dcom.sun.management.jmxremote.rmi.port=9010 -Dcom.sun.management.jmxremote.local.only=false -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false
For example:
java -Dcom.sun.management.jmxremote \ -Dcom.sun.management.jmxremote.port=9010 \ -Dcom.sun.management.jmxremote.local.only=false \ -Dcom.sun.management.jmxremote.authenticate=false \ -Dcom.sun.management.jmxremote.ssl=false \ -jar Notepad.jar
Note:
Additional Tip:
If you encounter connection issues, try setting the following parameter as well:
-Djava.rmi.server.hostname=127.0.0.1
The above is the detailed content of How do I enable remote JMX access to a JVM using JConsole?. For more information, please follow other related articles on the PHP Chinese website!