Obtained from Using stdin
Technical Q&A
Java 02 - Using stdin on the Macintosh (7-December-1998)
--------------------------------------------------------------------------------
Q: How do I use stdin to get user input on the Macintosh?
A: To use standard in on the Mac you will need to use JBindery (part
of the MRJ SDK) to make a double-clickable Macintosh application out
of your class. Make sure you are using version 2.1 EA3 (or later) of
the SDK. This will only work with an application (no applets) so your
code will need a static public void main(String args[]) method defined
as the entry point. Once you create your class as an application, you
drag-and-drop the .class file on the JBindery application in the MRJ
SDK. It will present you with a multitude of options. The ones we care
about for this case are in the "Command" section (the one that comes
up by default). Use the "Redirect stdin:" popup to change it to
"Message Window". Then click on the "Save Settings..." button and save
your settings as an application using the standard save dialog
presented. Once this is done, you can run your application by
double-clicking on the newly saved app, and use the messages window
for stdin and stdout. For more detailed information about this or
about using JBindery in general, please refer to the JBindery
documentation in the MRJ SDK.
--------------------------------------------------------------------------------
-- Levi Brown
Worldwide Developer Technical Support