Set Windows System Variables with Java

前端 未结 3 552
刺人心
刺人心 2021-01-15 13:02

is there a way to add a specific directory to the Windows systemvariable %PATH%? This doesn\'t seem to work:

String[] cmd = { \"cmd\", \"/c\", \"set\", \"PAT         


        
3条回答
  •  太阳男子
    2021-01-15 14:00

    This is not possible with just running a batch file. See here for details.

    Your solution doesn't work, because it only modifies the environmental variable in the process level and not in system level.

提交回复
热议问题