Java Reference
In-Depth Information
After you have installed the kit, run the Java interpreter to see that it works. Type the fol-
lowing command at a command line:
java -version
In the preceding example, java is the name of the Java interpreter program and -version
is an argument that tells the interpreter to display its version number.
You can see an example of this in Figure A.5, but your version number might be a little
different depending on what version of the kit you have installed.
Running a program
FIGURE A.5
Running the Java
interpreter in a
command-line win-
dow.
If java -version works and you see a version number, it should begin with 1.6. Sun
sometimes tacks on a third number, but as long as it begins with 1.6 you are using the
correct version of the Java Development Kit.
If you see an incorrect version number or a Bad command or filename error after running
java -version , you need to make some changes to how the Java Development Kit is
configured on your system.
Sun Microsystems has a history of confusing name and version
changes related to Java. Though the language is called Java 6 and
the JDK is designated JDK 6.0, the internal version number of the
kit is 1.6.0. This internal number shows up in the -version com-
mand as well as the choice of installation folder for the kit.
When all else fails, run the java -version command to make sure
the right development tool has been installed on your system. If it
begins with 1.6, you've got the right tool to develop programs for
Java 6.
CAUTION
Search WWH ::




Custom Search