If you only need to use the JAVAC command you don't need to be so complicated.
You first delete your own new java_home, Classpath, and the Java_home%\bin;%java_home%\jre\bin in the path variable,
Then just add the following path to the head of the PATH variable:
C:\Program Files\java\jdk1.5.0\bin, it's OK. (No need to add anything else)
The reason is simple: You can follow this path to see if there is a javac.exe. In the Bin folder, the role of the environment variable path is used to tell your computer how to find the executable file and execute it.
If you're a beginner. CLASSPATH environment variables can be configured because the CLASSPATH variable is used to set the "Classpath" (in fact, this is not recommended by Sun). The purpose of setting the CLASSPATH variable white is actually to put the other people write good class library to move over the future of their own use.
The original allocation environment variables, with Java_home, classpath and path.
In fact, no need to match a path on the OK.