Cannot compile file

First timer trying to learn Java. Have Java JDK version 1.5.0_04 and in trying to compile my first program; I get this error message:

'javac' is not recognized as an internal or external command, operable program or batch file.

I have followed all the directions to the letter in the book that I am using "Programming with Java in 24 Hours".

Running Windows XP Home Edition on a Compaq Presario 700 laptop.

Am at a lost as what to do. Need help!

[478 byte] By [fishboya] at [2007-11-27 8:10:26]
# 1
http://java.sun.com/docs/books/tutorial/getStarted/problems/index.html
prometheuzza at 2007-7-12 19:54:01 > top of Java-index,Java Essentials,Java Programming...
# 2
1) Throw that book away. http://norvig.com/21-days.html2) You need to set your PATH variable (NOT CLASSPATH). http://java.sun.com/javase/6/webnotes/install/jdk/install-windows.htmlScroll down to the part about setting the path.
jverda at 2007-7-12 19:54:01 > top of Java-index,Java Essentials,Java Programming...
# 3
Sorry for taking a few days to replay back to you. Thanks for your help.
fishboya at 2007-7-12 19:54:01 > top of Java-index,Java Essentials,Java Programming...
# 4
Thanks for your help.
fishboya at 2007-7-12 19:54:01 > top of Java-index,Java Essentials,Java Programming...
# 5
> Thanks for your help.You're welcome. Did you manage to resolve your problem?
prometheuzza at 2007-7-12 19:54:01 > top of Java-index,Java Essentials,Java Programming...
# 6
> Sorry for taking a few days to replay back to you.> Thanks for your help.No problem. You're quite welcome. Sorry if I sounded cranky--I probably was. :-)Did you get it all straightened out, or do you still have questions?
jverda at 2007-7-12 19:54:01 > top of Java-index,Java Essentials,Java Programming...
# 7

Reason that I can think of is quite simple, you don't have your java path set.

First check following things:

1. Do you have JDK installed?

2. write javac on command line and enter. If it shows a message like "not recognized as any command, than probably you haven't set classpath for java home directory.

3. Set your class path using following directions:

4. Go to my computers -->right click-->properties-->advance-->environment variables. A window opens.

5. On the bottom side, click on path and then click on edit.

6. Append this string to variable Value text box : ";C:\Program Files\Java\jdk1.5.0_04\bin;"

Your program should compile properly after that.

If it doesn't work correctly, copy the variable value and post it here.

vineet.mangala at 2007-7-12 19:54:01 > top of Java-index,Java Essentials,Java Programming...
# 8

ya everyone seen to be correct here saying about the class path...

just set JAVA_HOME="the path where your jdk is installed" in the system variables so that any user whoever will log in can compile java...if u set in user variable then only specefic user will be able to compile java...for eg..my java home is C:\jdk1.5.0_06....

then set path="your bin directory in JAVA_HOME" again in the system variables...for eg.."C:\jdk1.5.0_06\bin"...

Then if u want u can set classpath=" JAVA_HOME/lib/tools.jar"... but that is mandatory.....

sabyasachi.roya at 2007-7-12 19:54:01 > top of Java-index,Java Essentials,Java Programming...