Geez, did you even bother to look at the sample code I suggested? It contains exactly this use case (line 45 in WPAMenu.java). And there is also the use case of running an external command in WPAAction.java.
Java is very to easy to understand once you got the fundamental concept of object-oriented programming. And the documentation is excellent. For example:
http://docs.oracle.com/javase/1.4.2/...ng/String.html