Windows 10 上的环境变量太大 [英] Environment variable is too large on Windows 10

查看:19
本文介绍了Windows 10 上的环境变量太大的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近从 Windows 8.1 升级到了 Windows 10.

I have recently upgraded to Windows 10 from Windows 8.1.

现在我想为我新安装的 Apache Maven 设置一个环境变量.

Now I wanted to set an environment variable for my new installation of Apache Maven.

每次我创建用户变量时,一切都很好.但是,我还需要创建系统变量,我需要将 bin 目录附加到我已经在用户变量中创建的变量中作为路径".

Each time I created the user variable, things were fine. However, I also need to create the system variable where I will need to append the bin directory to the variable that I already create in the user variable to be "path".

现在,每次执行此操作时,都会收到一条错误消息,提示此环境变量太大".因此,我无法创建路径.

Now, each time I do this, I get an error that says "This environment variable is too large". As a result of this, I am unable to create the path.

我附上了这个错误的图片.

I have attached an image of this error.

推荐答案

当 PATH 环境变量因值过多而过载时,您将无法再添加值.尝试以下方法应该可以解决您的问题.

When the PATH environment variable gets overloaded with too many values it reaches a point where you cannot add values any more. Trying the following should solve your problem.

解决方案 1:

  1. 创建一个新的系统环境变量,比如NEWPATH"
  2. bin 目录位置分配给NEWPATH"
  3. 现在附加';%NEWPATH%' 到 PATH 环境变量
  1. Create a new system environment variable, say 'NEWPATH'
  2. Assign the bin directory location to 'NEWPATH'
  3. Now append '; %NEWPATH%' to the PATH environment variable

如果这仍然不起作用,请尝试将 PATH 环境变量的某些部分已经存在的值复制到NEWPATH",然后附加NEWPATH".

If this still doesn't work then try to copy some part of the PATH environment variable already existing values to the 'NEWPATH' and then append the 'NEWPATH'.

解决方案 2:

如果可以对路径进行分组和缩短,请检查 PATH 环境变量的值.例如,

Check the value of the PATH environment variable if you can group and shorten the paths. For example,

C:Program FilesMicrosoft SQL Server102ToolsBinn;C:Program FilesMicrosoft SQL Server102DTSBin;

C:Program FilesMicrosoft SQL Server102ToolsBinn;C:Program FilesMicrosoft SQL Server102DTSBin;

可以组合为

C:Program FilesMicrosoft SQL Server;

C:Program FilesMicrosoft SQL Server;

通过这种方式,您可以在固定长度的 PATH 变量中构建更多空间,并最终将您的 bin 目录位置调整到 PATH 中.

In this way, you can build more space into your fixed length PATH variable and finally adjust your bin directory location into PATH.

这篇关于Windows 10 上的环境变量太大的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆