This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
Originally posted by Ulf Dittmer: I'm not sure if it works -of course it's easy to try- but if so, you need to leave out the "-D" in the name of the property.
Agreed... just try it. But it is unlikely that it will work. I think the Java 5 mbean server is created, along with the RMI connector (that you are trying to configure), before the main method is called.
Is there a way to monitor non Java programs through java? I mean i have a JMX Monitoring program, so my plan was to start the non java programs using java, and then notify JMX somehow.
This is how i started a non java app...
Something like the one above is what i would prefer. The other way that i am doing it now is to set the JMX options for this program while running it. But with such a method i would have to run an instance of this program for each non java application that i monitor(with the -Dcom.sun.management.jmxremote argument passed to the VM) which is not a nice solution.
Whatz the best way to do this with my monitoring tool?
Originally posted by pradeep selvaraj: Henry, Could you please explain it a bit more.
Basically, in windows, you can use the "tasklist" command to monitor what proceses are running. And in unix/linux, you can use the "ps" command to monitor what processes are running. "tasklist" is fully documented on the microsoft site, and you can do a "man ps" for "ps".
Anyway, from Java, you may call out to the operating system commands with the Runtime.exec() set of methods.