Java Reference
In-Depth Information
Use the Command Line
The command line looks something like this on my computer. Yours may use
different colors and fonts, and you can usually set these to your liking. I
apparently prefer black letters on a tan background:
You access the command line a little differently depending on the kind of
operating system you're running, which will be one of these:
Windows comes with a very bare-bones command line. You get to it by running
cmd.exe . If your version of Windows has a “Start” command, then you might
be able to select Start -> Run and enter cmd.exe or just use the search box
that comes up to find and run cmd.exe . But I don't recommend using cmd.exe
by itself; see the instructions in the box on page 4 .
On Mac OS X, open the command line via Applications -> Utilities -> Terminal.
If you're running Linux, you likely already know how to get to a command-line
shell. But for the sake of completeness, and because it's called different things,
try any of these: open a shell, start a Konsole, or right-click on the Desktop to
open a Terminal.
(Fortunately, all of these pesky differences between Windows, Mac, and Linux
disappear once you're writing Java code: Java runs the same on each platform.)
Once you have your command-line application up and running, you're ready
to type commands into the command-line processor, or shell , as I'll call it.
You'll be using a few simple commands that I'll show you as we go along.
Each shell prints out a short message indicating it's ready for you to type
something in. But instead of a straightforward prompt like “Ready for you to
type, master,” most command prompts are a little more cryptic.
Windows will show something like C:\> . Linux and Mac systems might show
$ or % . Any of these prompts might include additional information, like your
name, the computer's name, or a directory name. Since that will be different
for everyone, I'm going to choose the simplest one for the examples in this
topic and show the command prompt as a $ . Whatever your prompt looks
like, that's where you type in commands.
Search WWH ::

Custom Search