startjmx

startjmx is a small utility to start a JMX agent of the target JVM without restarting it. Works only on Java 6 or later.

Using startjmx

startjmx is used from the command line and it is called like this:

java -jar startjmx.jar [-? | -h | -help | --help | --version]
java -jar startjmx.jar PID [MANAGEMENTJAR]

where:
  • PID is PID for the JVM which JMX agent is to be started.
  • MANAGEMENTJAR, Optional. A path to management-agent.jar. Default is $JAVA_HOME/lib/management-agent.jar.

Examples:

java -jar startjmx.jar -?
java -jar startjmx.jar 50001
java -jar startjmx.jar 50001 /usr/lib/jvm/jre-1.6.0-openjdk/lib/management-agent.jar

Requirements

  • Java 6 or later
  • Be aware that a dependency to Sun's tools.jar is a system dependency and thus needs to be set accordingly if you are to compile this utility from the source. In Sun's reference implementation (1.6) this artifact is called tools.jar but, for example, on Mac OSX 10.6 needed classes are in classes.jar.

    Also, when running the utility the same artifact must be found from the class path, of course.

Download

Download from JMX Tools page.

License

MIT License

Copyright (c) 2010 Hapi, http://www.hapiware.com

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License