You are on page 1of 5

Downloading and Installing Java On Windows: Prevent Errors like --> 'javac' is not recognized as an internal or external command

1. Go to http://java.sun.com and download the latest Version of Jave SDK or any Jace SDK as per your requirement and install on your system. 2. Accept all of the defaults and suggestions, but make sure that the location where Java will be installed is at the top level of your C: drive. Click on "Finish." You should have a directory (folder) named C:\j2sdk1.5.0_04, with subfolders C:\j2sdk1.5.0_04\bin and C:\j2sdk1.5.0_04\lib 4. Modify your system variable called "PATH" (so that programs can find where Java is located). To do this for Windows 2000 or XP, either right-click on the My Computer icon or select "System" on the control panel. When the window titled "System Properties" appears, choose the tab at the top named "Advanced." Then, click on "Environment Variables." In the bottom window that shows system variables, select "Path" and then click on "Edit..." Add C:\j2sdk1.5.0_04\bin as the first item in the list. Note that all items are separated by a semicolon, with no spaces around the semicolon. You should end up with a path variable that looks something like C:\j2sdk1.5.0_04\bin;C:\WINNT\system32;C:\WINNT;C:\WINNT\system32\Wbem For Windows 98 or ME, open the file AUTOEXEC.BAT in Notepad. You should find a line in this file that begins SET PATH=... Modify this line to add C:\j2sdk1.5.0_04\bin; immediately after the equals sign. 5. Modify or create a system variable called "CLASSPATH," as follows. In the lower "System Variables" pane choose "New..." and type in Variable Name "CLASSPATH" and value (note that it begins with dot semicolon) .;C:\j2sdk1.5.0_04\lib 6. To test Java to see if everything is installed properly, open a command window (a DOS window) and type the command "javac" The result should be information about the Usage of javac and its options. If you get a result that "'javac' is not recognized as an internal or external command, operable program or batch file" then there is a problem and Java will not work correctly.

Steps
1. 1
Download the latest version of the *Java JDK from Sun Microsystems. Ads by Google Java What Language Do You Think In? Download The Azure Free Trial Today windowsazure.com

2. 2

Figure 1: The installer (JDK 6) running.

Double-click on the install file and it should open an installer (Fig. 1).

3. 3
Click next, then read and accept the license.

4. 4

Figure 2: The options you should not touch.

On the next screen you will encounter some options. Just leave these alone and click next unless you know what you are doing. (Because this is being read it is assumed that you do not.)(Fig. 2)

5. 5

Figure 3: Installing the JDK.

The next page you encounter should install (and in some cases download) the Java Development Kit. (Fig. 3)

6. 6
After the installer is finished, open run by clicking Start > Run... or by typing Windows Key + R.

7. 7
In the text box, type "cmd" and click "OK".

8. 8

Figure 4: The command prompt running.

A simple window should be opened with a black background and a text prompt. This is called the "Command Prompt." My command prompt background is red, but it could really be any color. (Fig. 4)

9. 9

After focusing the window, type "javac" and press enter. If the prompt returns something along the lines of: "'javac' is not recognized as an internal or external command, operable program or batch file" then continue with the next step. If it shows many more options and lines, skip to step 15.

10.

10

Open the properties of "My Computer" by either right-clicking the icon on the desktop or right-clicking Start > My Computer. When the pop up menu opens, scroll to the bottom and select "Properties".

11.

11

Figure 5: Editing system properties.

This should open a window named "System Properties". Click on the "Advanced" tab and then click "Environment Variables". (Fig. 5)

12.

12

Next, another window opens with a lot of confusing sentences and letters. Double-click on the "Path" variable on either of the option boxes. It is recommended to edit the variable in the box "User variables for (your username)".

13.

13

Once the variable is opened, a text box in yet another window appears. Careful not to delete anything in this box. At the end of the text box, add a semi-colon if there is not one already, and add "C:\Program Files\Java\jdk1.6.0\bin" to the text box. This is assuming you did not change the file path of the installation.

14.

14

Click "Apply" and "OK" to all the windows you have just opened. Open the command prompt again, while following steps 6-9 to see if that "javac" command works.

15.

15

Congratulations! You have taken your first step to starting Java programming.

You might also like