You basically want to access the command line right? Every jvm is started by a runtime environment and has a reference to that environment.
Runtime rt = Runtime.getRuntime();
Gets a reference to the runtime environment that started the jvm. You can then execute an array of commands with:
rt.exec(cmd[]);
There is, of course, much more complexity than this, but google "java Runtime.exec" and you'll find several articles about this subject.
http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html Is a good place to find some of the more common mistakes explained.
Michael Crutcher