简体   繁体   English

在用户变量和系统变量中设置Java的路径有什么区别?

[英]What is the difference between setting the path for Java in user variables and system variables?

I'm installing Java on my windows. 我正在Windows上安装Java。 I'd like to know the difference between setting the path for Java in user variables and setting it in System variables? 我想知道在用户变量中设置Java路径和在系统变量中设置它的区别吗?

System variables are shared between all the users on the machine. 系统变量在计算机上的所有用户之间共享。 User variables are specific to a single user. 用户变量特定于单个用户。

Ultimately, they will both have the same effect, and the decision should depend on who needs to use Java on the machine. 最终,它们都会产生相同的效果,决定应该取决于谁需要在机器上使用Java。

If you set the path in user variables the path in only visible for the user. 如果在user variables设置路径,则该路径仅对用户可见。 In system variables this path is visible for all users. system variables此路径对所有用户都可见。

系统变量=所有用户,用户变量=用于设置帐户的用户。

Right-click My Computer and go to Properties->Advanced->Environmental Variables ... Right-click My Computer and go to Properties->Advanced->Environmental Variables ...

What's above are user variables , and below are system variables . 以上是user variables ,以下是system variables The elements are combined when creating the environment for an application. 在为应用程序创建环境时,将组合这些元素。 System variables are shared for all users, but user variables are only for your account/profile. 系统变量为所有用户共享,但用户变量仅适用于您的帐户/配置文件。

Environment variables are 'evaluated' (ie. they are attributed) in the following order: Environment variables按以下顺序“评估”(即它们被归因):

System variables
Variables defined in autoexec.bat
User variables

In simple words, 简单来说,

System environment variables are global to all users, while users environment variables are specific only to the currently logged in user. 系统环境变量对所有用户都是全局的,而用户环境变量仅特定于当前登录的用户。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM