Why do Java environment variables have to be set so

Source: Internet
Author: User
Tags tomcat server

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.