Windows 7 environment variable not working in path

后端 未结 14 2091
[愿得一人]
[愿得一人] 2020-12-07 23:00

I am trying to set up some path using environment variable. I added an environment variable \"MAVEN_HOME\" with the value \"C:\\maven\". Then in the path I added \"%MAVEN_HO

相关标签:
14条回答
  • 2020-12-07 23:35

    To address this problem, I have used setx command which try to set user level variables.

    I used below...

    setx JAVA_HOME "C:\Program Files\Java\jdk1.8.0_92"
    
    setx PATH %JAVA_HOME%\bin
    

    NOTE: Windows try to append provided variable value to existing variable value. So no need to give extra %PATH%... something like %JAVA_HOME%\bin;%PATH%

    0 讨论(0)
  • 2020-12-07 23:37

    Check if there is a space character between the previous path and the next:

    Incorrect: c:\path1; c:\Maven\bin\; c:\path2\

    Correct: c:\path1;c:\Maven\bin\;c:\path2\

    0 讨论(0)
  • 2020-12-07 23:38

    In my Windows 7.

    // not working for me
    D:\php\php-7.2.6-nts\php.exe
    
    // works fine
    D:\php\php-7.2.6-nts
    
    0 讨论(0)
  • 2020-12-07 23:40

    Copy the value of path to notepad and check if this corresponds with the echo %path% in terminal window and make changes if needed. Then delete the old path value and paste the notepad value back in. I assume some invisible character entered there by some installation corrupted the path value.

    0 讨论(0)
  • 2020-12-07 23:42

    If there is any error at all in the PATH windows will silently disregard it. Things like having %PATH% or spaces between items in your path will break it. Be warned

    0 讨论(0)
  • 2020-12-07 23:44

    My issue turned out to be embarrassingly simple:

    Restart command prompt and the new variables should update

    0 讨论(0)
提交回复
热议问题