Environment Variable failure

Source: Internet
Author: User

Environment Variable failure

Two days ago I got a tiny tool that automatically configures JDK environment variables (details: http://www.cnblogs.com/chr-wonder/p/5208541.html ). Some minor problems were found during the debugging process. Record it here.

In the process of writing the Path environment variable, Because I add a new item at the end of the Path variable, in order to avoid conflicts (or adhesion) with the original item ), insert a; (semicolon) at the frontend of the items I inserted to separate new items. However, after the Path variable is written, the Path variable does not take effect. This left me wondering.

First, I considered whether it was because I wrote it in the user environment variable. I quickly rejected this idea because the user environment variables play the same role as the system environment variables (for the current user.

Then I considered whether it was necessary to restart. However, other environment variables take effect, but Path does not. No worries. test again after restart. The Path still does not take effect.

Finally, I carefully checked the environment variables I inserted. I found that the system I tested was a new system that was just installed. Before I wrote the environment variable, there was no Path variable in the user environment variable. So the Path variable I modified becomes: "; % JAVA_HOME % ...... "Starts with; (semicolon. After I delete the semicolon, the Path variable takes effect normally.

After some tests, I found that the Path variable starts with; (semicolon), which will invalidate the Path variable. At this point, the source of environment variable failure is found.

Why does the Path variable start with; (semicolon) become invalid? I don't understand it for the moment. I just got such a phenomenon from the test (this is not an example ). If anyone knows, please don't hesitate to give me your advice. Thank you very much. If you have any questions, please leave a message and learn from each other.

Related Article

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.