Is the so-called: reading to know it, but also to know why. Java Beginners (I am also the old rookie) often set environment variables when not successful, in fact, they do not really understand the real thing inside. So today from the book "Copy" Good and good, but the next time there is a reload problem.
Before speaking, please select Start menu, point Run, enter cmd, and then enter regedit in the console, return to see the registration form out. This is how the process. In fact, when we enter Regedit, the system will go to the system environment variables to find the program executable path. Then we can open the system environment variable settings, we will see the system variable windir value of%systemroot% (in fact, c:/windows if the system installed in the words of c), we again open c:/windows, how, Did you find a program called Regedit.exe?
Understand this, I think we should be clear, set the purpose of the system variable: In order to enable the system to find the running path of the program.
When you set the environment variable path, the reason to choose C:/Program Files/java/jdk1.6.0/bin (I was installed in the C-disk). Everyone opened the directory and found that it was full of executable files, including our most familiar javac.exe,java.exe and so on. Yes, the reason to choose Bin is because when we compile the program, in the console input Javac Hello.java is, the system to the system environment variable to find the Javac.exe path of the execution program.
So you see here, I think I should know the reason for the other variable settings. At the same time also believe that everyone understand, you can smoothly in the future of the settings to save time.
The variable for Tomcat server is also a point.