How to set up your PC to run J2SE

One way to run the Java SE 6 Platform by using two DOS commands: javac and java. In order to make it relatively easy to run these commands, you should set your machine's PATH environment variable to include the directory that the java executables (javac and java) are in. If you install the latest update of Jave SE from the Sun Website, by default the Java executables (java and javac will be placed in C:\Program Files\Java\jdk1.6.0_14\bin. If you install a different version of Java, or if you specify a different destination path during installing, the required path will be different.

Here's how to change your Path variable on a PC which runs Windows XP.

  1. Find the System icon in the control panel and double-click on it. You will see this:

  2. Click on the "Advanced" tab. Then you will see this.

  3. Next, click on the "Environment Variables" button. Under "System variables", you should find "Path". Highlight this variable:

    If you do not have administrator priveleges, you may need to edit (or create) the Path environment variable in the "User variables" section of the above window.

  4. Then click Edit. The path will probably already be set to include several directories. Use the right arrow curser key to scroll to the end of the "Variable value:" textbox. Then type a semicolon at the end of the existing path, followed by the name of the java executable directory (C:\Program Files\Java\jdk1.6.0_14\bin). You may need to place double quotes around this path. See the screenshot below (Note: the screenshot below is for an earlier version of Java SE, rather than Java SE 6 update 14):

    If you have installed a different version of Java, then change the above line accordingly.

  5. Click "OK" several times (in order to close all of the System windows) and then restart your computer.