Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
946 views
in Technique[技术] by (71.8m points)

jenkins - ant - not recognized as an internal

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 command, operable program or batch file.

where i'm going wrong.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

That just means it's not on the path.

Edit your PATH environment variable to include Ant's "bin" directory. The exact steps for editing your path with depend on your operating system, but for example on XP:

  • Bring up Explorer (Windows-E)
  • Right-click on "My Computer" and select "Properties"
  • On the "Advanced" tab, click on "Environment Variables"
  • If the set of "user variables" already contains a PATH entry, edit that. Otherwise create a new entry. (If you want it to affect all users, set it as a system environment variable.)
  • Add the Ant bin directory without any quotes. Use a semi-colon to separate it from another entry. For example, you might have:

    c:Program FilesUtils;c:Program FilesAnt 1.7in
    
  • Start a new Command Prompt to see the changes (they won't affect existing windows)

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...