Embed in script
Jmxterm is not designed to hide JavaSE JMX liberary from a Java program. But with small effort, Jmxterm can be called in programmatic manner from script language such as PERL or Shell.
To wrap JMX with objects easy to call by scripting language such as Groovy or beanshell, there are other technologies designed to help such scenario. For example Groovy JMX provides some classes that wraps an MBean and expose nice API. Jmxterm itself doesn't provide scripting features such as variable manipulation or flow control keywords.
However since the commands in Jmxterm comes from standard input, modern script environment that handles stdin nicely, such as SHELL or PERL, can easily combine scripting feature with Jmxterm by using input pipe. Following example is a small PERL segment that connects to an MBean server and list domains.
Since PERL supports pipe programming nicely, Jmxterm easily fits in PERL programming.
Following example is to call Jmxterm from shell. This particular command is useful when you want to get the PID of JVM process that listens to a known JMX port.