Follow this process to enable MBean discovery in a stand-alone Java application.

1

Instrument your code as specified in Model MBean Naming and Descriptor Data, or use Spring framework instrumented JAR files.

2

Start the application with the spring.managed.application.name system property.

For example,

java -Dcom.sun.management.jmxremote -
Dspring.managed.application.name="MyApplicationName" com.sample.MyApp

The application name is set as the name of the discovered resource. For example, when using the code in step , the application name is set as MyApplicationName.