Originally posted by Anand Hariharan:
Either you do not have the JDK installed (i.e., only the Java runtime environment, not the Java development kit), or javac for some reason, is not in the path, while java is.
Agree. It is possible you have the JRE (Java Runtime Environment) installed and not the JDK. that would mean you can run Java but not create new programs.
If you need to download the JDK, try
here: click the button nearest the top of the page. It gives you installation instructions.
This part of the Java Tutorial tells you about "getting started;" note the "Common Problems" link, and at the end of "common problems" there is a link to how to set the PATH.

Good luck with it.