Improve a bit the JMX command and convert it to Java