How do I fix maven error The JAVA_HOME environment variable is not defined correctly?

后端 未结 19 1119
误落风尘
误落风尘 2021-02-01 01:33

Issue:

I am getting the Maven error \"The JAVA_HOME environment variable is not defined correctly\" when I run through Inno setup batch execution. Howe

19条回答
  •  栀梦
    栀梦 (楼主)
    2021-02-01 02:17

    The SETX command does not modify the current environment.

    If you run the following batch file:

    setx AAA aaa
    echo AAA=%AAA%
    

    It will print

    AAA=
    

    So your batch file is wrong. You have to use set:

    set AAA=aaa
    

    See What is the difference between SETX and SET in environment variables in Windows.

提交回复
热议问题