I don't think that would work in windows. Local echo suppression
would be a command to the command interpreter which is not even
necessarily running at the point your program is. If it works in
Unix, that means Java implements the console in a more native way.
Java doesn't implement the text console that it runs in on either
platform, the OS does. Java reads stdin from a file descriptor in both
cases.
It has nothing to do with the command interpreter either. The OS
provides the console as a logical device (e.g. /dev/tty on unix, con:
or something like that on windows) that the process communicates with
through the file descriptor. Changing the console mode is a simple
matter of configuring the device to behave differently (assuming that
it has that capability).
On Unix and similar platforms like Linux, there is a set of APIs for
configuring the console (unavailable to Java), and a command line tool
"stty" (which can be used either from within the Java application, or
in the shell prior to starting the application).
Potientially the mechanism should work on Windows if the console has
such a capability and there is a way to manage it from an application,
however I have no idea what facilities might be available. That
doesn't prevent me from posting a solution that is sufficient for some
users though.
/gordon