To enable JMX (Java Management Extensions) in Apache Tomcat on a Windows system, you can follow these step-by-step instructions:
- Open the Tomcat installation directory in Windows Explorer.
- Navigate to the
bin
directory. - Locate the
catalina.bat
file and open it in a text editor. - Search for the
set JAVA_OPTS
line in thecatalina.bat
file. It may look like this:bashCopy codeset JAVA_OPTS=%JAVA_OPTS% <some_other_options>
- Add the following options to the
JAVA_OPTS
line to enable JMX:bashCopy codeset JAVA_OPTS=%JAVA_OPTS% -Dcom.sun.management.jmxremote ^ -Dcom.sun.management.jmxremote.port=9999 ^ -Dcom.sun.management.jmxremote.ssl=false ^ -Dcom.sun.management.jmxremote.authenticate=false
The above configuration sets JMX to listen on port9999
, disables SSL, and disables authentication. Adjust these values as needed for your specific setup. Note the^
symbol at the end of each line, which indicates a line continuation in the Windows batch file. - Save the changes to the
catalina.bat
file. - Open a command prompt as an administrator.
- Navigate to the
bin
directory within the Tomcat installation directory. - Execute the following command to start Tomcat:bashCopy code
catalina.bat run
- Tomcat will start with JMX enabled on the specified port. You should see log messages indicating the JMX configuration.
Sample
set "JAVA_OPTS=%JAVA_OPTS% %JSSE_OPTS% -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=9012 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false"
I’m a DevOps/SRE/DevSecOps/Cloud Expert passionate about sharing knowledge and experiences. I am working at Cotocus. I blog tech insights at DevOps School, travel stories at Holiday Landmark, stock market tips at Stocks Mantra, health and fitness guidance at My Medic Plus, product reviews at I reviewed , and SEO strategies at Wizbrand.
Please find my social handles as below;
Rajesh Kumar Personal Website
Rajesh Kumar at YOUTUBE
Rajesh Kumar at INSTAGRAM
Rajesh Kumar at X
Rajesh Kumar at FACEBOOK
Rajesh Kumar at LINKEDIN
Rajesh Kumar at PINTEREST
Rajesh Kumar at QUORA
Rajesh Kumar at WIZBRAND