ant - not recognized as an internal

后端 未结 8 2217
粉色の甜心
粉色の甜心 2020-12-09 09:49

I have installed ant(apache-ant-1.7.0). But when i run the ant command in dos command prompt, it says

‘ant’ is not recognized as an internal or external comm         


        
8条回答
  •  太阳男子
    2020-12-09 10:22

    Don't use Windows GUI for creating environment variables because they can mess up with the system. Easiest and best way to create a variable is creating them as local with a command script. This way they will be local and won't interfare with your system, and easier then using GUI :)

    Open up a blank notepad, type the following (in case you are interested in building a Java project I added a JAVA_HOME variable as well). Replace the ant and jdk paths with whatever is correct for your machine

    set PATH=%BASEPATH%
    set ANT_HOME=c:\tools\apache-ant-1.9-bin
    set JAVA_HOME=c:\tools\jdk7x64
    set PATH=%ANT_HOME%\bin;%JAVA_HOME%\bin;%PATH%
    

    run the script and check the location with echo %ANT_HOME%.

提交回复
热议问题