Setting the Path for Java

After you install the JDK, you need to configure your OS so that it can find the JDK command line tools. Start by setting the Path environment variable — a list of folders that the OS uses to locate executable programs. To do this on a Windows XP, Windows Vista, or Windows 7 system, follow these steps:

1. Click the Windows (Start) button and then right-click Computer (Windows 7 or Vista) or My Computer (XP).

This brings up the System Properties page.

2. Click the Advanced tab (XP) or the Advanced System Settings link (Vista and 7); then click the Environment Variables button.

The Environment Variables dialog box appears.

3. In the System Variables list, scroll to the Path variable, select it, and then click the Edit button.

A dialog box pops up to let you edit the value of the Path variable.

4. Add the JDK bin folder to the beginning of the Path value.

tip.eps Use a semicolon to separate the bin folder from the rest of the information that may already be in the path.

Note: The name of the bin folder may vary on your system, as in this example:

c:\Program Files\Java\jdk1.7.0\bin;other directories...

5. Click OK three times to exit.

The first OK gets you back to the Environment Variables dialog box; the second OK gets you back to the System Properties dialog box; and the third OK closes the System Properties dialog box.

Get Java For Dummies Quick Reference now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.