Sorry for you, but I think it's impossible. Under DOS, there is no standard mechanism (in any language) to implement a keyboard listener. It's always a matter of waiting for an input result or a key to be pressed in a blocking method. Of course, you can do it by trapping interrupts, but it's no more java. 
Key listeners only work under AWT. It is not possible to listen to Events on a CLI (Command Line Interface / Interpreter) like DOS or a Shell (tty or xterm). Key Events don't exist there. It is just bytes in streams. Alas, the InputStreams DOS->Java are buffered, so you will probably have problems using InputStreams. I think Java wasn't meant for terminal / keyboard driven programs