If you want to get the "java" and "javac" commands working in the Windows command prompt then follow the steps below. These are the same for Windows XP, Vista and Windows 7. In each case you need to get to the Advanced tab in your System Properties. You can search for "environment variables" in Windows help to tell you where to locate this if you are not sure.
Before you begin download the latest Java JDK from: https://cds.sun.com/is-bin/INTERSHOP.enfinity/WFS/CDS-CDS_Developer-Site/en_US/-/USD/ViewProductDetail-Start?ProductRef=jdk-6u22-oth-JPR@CDS-CDS_Developer (make sure you choose the JDK for the correct version of Windows)
Step 1: Load the System Properties
Right button on the My Computer icon and select Properties from the menu.
Step 2: Find the Advanced Tab in the Properties Window
Click Environmental Variables
Step 3: Scroll down in the System variables and find the PATH variable
Select the PATH variable and click the Edit button
Step 4: Add the Java installation path to the PATH variable
Add the Java installation path to the list AFTER the existing text.
In Windows XP add:
In 64-bit Windows (Windows XP 64-bit, Windows 7 (please check)) add:
When you have completed this you will need to log on and restart your computer. When you have restarted you should be able to run "java" and "javac" from the Windows command prompt.