‘javac’ is not recognized as an internal or external command

1. Go to http://java.sun.com and download the latest Version of Java SDK or any Jave SDK that 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

3. 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.

4. 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

5. 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.