You can start the Jolokia JVM agent programatically, too. The entry point is org.jolokia.jvmagent.JolokiaServer
(to be found in the module jolokia-jvm
). Please refer to the source, there is quite some documentation there.
Or if you are using Spring, there is even a easier solution. Simply include the Jolokia Spring config XSD and declare the agent bean in the Spring application context. More can be found in the reference manual.
Finally if you have web you could also declare the Jolokia servlet in you web.xml. See also here for the details.
When you want to automatically download the agent, you could add the Maven dependency with the classifier agent
.
If you need further assitance please come to the Jolokia Forum and describe your use case there (think that is the proper place for concrete Jolokia questions).