Java and the Windows Command Prompt
Java and the Windows Command Prompt
interpreter java to run them. You should skip the first step if Java is already
installed on your machine.
Download and install the latest version of the Java Platform, Standard Edition
Development Kit (Java SE 6 Update 27). Note the installation directory for later—
probably something like C:\Program Files\Java\jdk1.6.0_27\bin.
To make sure that Windows can find the Java compiler and interpreter:
Select Start -> Computer -> System Properties -> Advanced system settings -
> Environment Variables -> System variables -> PATH.
[ In Vista, select Start -> My Computer -> Properties -> Advanced ->
Environment Variables -> System variables -> PATH. ]
[ In Windows XP, Select Start -> Control Panel -> System -> Advanced ->
Environment Variables -> System variables -> PATH. ]
Command-line interface
Launch the command prompt via All Programs -> Accessories -> Command Prompt.
(If you already had a command prompt window open, close it and launch a new one.)
You should see the command prompt; it will look something like:
To check that you have the right version of Java installed, type the text in
boldface below. You should see something similar to the information printed below.
(It's important that you see the number 1.6 or 1.5 for the Java version number, but
the rest is not critical.)
C:\Users\username>java -version
java version "1.6.0_27"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.6.0_27-b07)
Java HotSpot(TM) Client VM (build 1.6.0_27-b13, mixed mode, sharing)
Then type:
C:\Users\username>javac -version
javac 1.6.0_27
Since you will be using the Command Prompt frequently, we recommend customizing
the default settings. Right-click the title bar of an open Command Prompt window,
select Properties and then: