Home > Java > javaTutorial > body text

How to Enable JMX on a JVM for Remote Access with jconsole?

Susan Sarandon
Release: 2024-11-02 11:58:30
Original
914 people have browsed it

How to Enable JMX on a JVM for Remote Access with jconsole?

Activating JMX on a JVM for jconsole Access

Accessing a JVM remotely with jconsole requires enabling Java Management Extensions (JMX) on the JVM. To do so, start the program with the following parameters appended to the command:

-Dcom.sun.management.jmxremote: Enables remote JMX access.
-Dcom.sun.management.jmxremote.port=9010: Specifies the port for remote JMX access (default: 9010).
-Dcom.sun.management.jmxremote.local.only=false: Allows connections from remote hosts (optional).
-Dcom.sun.management.jmxremote.authenticate=false: Disables authentication for remote access (not recommended for production environments).
-Dcom.sun.management.jmxremote.ssl=false: Disables SSL for remote access.

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
Copy after login

Additional Considerations:

  • -Dcom.sun.management.jmxremote.local.only=false is not always required, but it may be necessary on Ubuntu.
  • -Djava.rmi.server.hostname=127.0.0.1 may need to be set to resolve connection issues in certain scenarios.
  • Disable authentication (-Dcom.sun.management.jmxremote.authenticate=false) with caution as it allows unrestricted access to the JVM.

The above is the detailed content of How to Enable JMX on a JVM for Remote Access with jconsole?. For more information, please follow other related articles on the PHP Chinese website!

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Articles by Author
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!