Java Reference
In-Depth Information
An Overview of the JDK
Although there are several dozen development environments you can use to create Java
programs, the most widely used is the Java Development Kit (JDK) from Sun
Microsystems, the set of command-line tools that are used to develop software with the
Java language.
There are two main reasons for the popularity of the kit:
It's free. You can download a copy at no cost from Sun's official Java website at
http://java.sun.com.
n
It's first. Whenever Sun releases a new version of the language, the first tools that
support the new version are in the kit.
n
The kit uses the command line—also called the MS-DOS prompt, command prompt, or
console under Windows and the shell prompt under UNIX. Commands are entered using
the keyboard, as in the following example:
javac VideoBook.java
This command compiles a Java program called VideoBook.java using the kit's compiler.
There are two elements to the command: the name of the compiler, javac , followed by
the name of the program to compile, VideoBook.java . A space character separates the
two elements.
Each kit command follows the same format: the name of the tool to use followed by one
or more elements indicating what the tool should do. These elements are called argu-
ments .
The following illustrates the use of command-line arguments:
java VideoBook add VHS “Invasion of the Bee Girls”
This command tells the Java interpreter to run a class file called VideoBook with three
command-line arguments: the strings add , VHS , and Invasion of the Bee Girls .
NOTE
You might think there are more than three command-line argu-
ments because of the spaces in the string Invasion of the Bee
Girls . The quotation marks around that string cause it to be con-
sidered one command-line argument, which makes it possible to
include spaces in an argument.
 
Search WWH ::




Custom Search