title: Java command line exit command?
body: <p>I'm making a server, and it is on a Text Based Raspberry Pi. basically, everything is running from the command line, so when the server runs, there is no graphics, and it prints everything out using <code>System.out.println();</code>. so my question is, instead of having a button that runs a <code>shutdown()</code> method, how can i make it so at any point in time, i am able to push, say, 'e', and the program will run the <code>shutdown()</code> method? i've done some searching, and am not sure quite how to phrase the question. i was thinking adding a <code>keylistener</code>, but im not sure if that can be added to nothing graphic? anyway, any help would be appreciated!!! thanks in advance</p>