I'll keep it simple, going with your criterion as I understand it:
any application running in terminal listening to user's commands. I.e. some command shell.
I'm a .Net guy (used to be a Java guy, too, but not so much anymore), so mine is a .Net solution.
There are a couple very easy ways with .Net to get input from the user. These work with .Net as well as Mono (I do all my Mono development under OS X, and this stuff all works).
If you wanted to prompt the user for a line of input (a string followed by the user hitting the return key), you could do something as simple as this:
Console.WriteLine("Enter some text, user:");
string userInput = Console.ReadLine();
This would print the line "Enter some text, user:" followed by a newline, so the user's input would appear on the line below "Enter some text, user:".
If you wanted to collect the user's input on the same line as your prompt, you could do this instead (just replace "Console.WriteLine" with "Console.Write" - also note that I put a space at the end of the prompt so the user's input text won't be smashed up against the end of the prompt text):
Console.Write("Enter some text, user: ");
string userInput = Console.ReadLine();
Here, whatever the user types will appear on the same line as "Enter some text, user: ".
If you want to get a single character from the user, you'd use the "ReadKey" method instead. Its return type is System.ConsoleKeyInfo. At its simplest, you can try to cast the return value's "KeyChar" property to a string, but ConsoleKeyInfo can also tell you if any modifier keys (shift, alt, etc.) were pressed, so it's worth reading the docs to understand the flexibility of this method and the ConsoleKeyInfo struct. This is a simple example that just gets what key was pressed without checking for any modifiers:
Console.Write("Press a key, user. G'head. Press one. I dare you.")
ConsoleKeyInfo keyInfo = Console.ReadKey();
string keyString = keyInfo.KeyChar.ToString();
In the above snippet, the key the user presses won't be displayed. If you want the key to be shown, you just call the overload of "ReadKey" that takes a bool - if you pass true, the user's input will be shown:
Console.Write("Press a key, user. G'head. Press one. I dare you.")
ConsoleKeyInfo keyInfo = Console.ReadKey(true); // Here's the difference...
string keyString = keyInfo.KeyChar.ToString();
For more info on ConsoleKeyInfo, such as how to check for modifiers, just follow the link I posted a couple paragraphs back.
I hope this is enough to help you get started. Apologies for not knowing the Java equivalents.
I also recommend that you read the docs for System.Console - there's a lot of sample code. Some of the code is only so-so (not as clear as it ought to be, in my opinion), but there's plenty of info :)