0
votes

ant.bat is not recognized as an internal or external command, operable program or batch file. Build step Invoke Ant marked build as failure Finished: FAILURE

How do I fix it?

2

2 Answers

0
votes

This is obvious that your job can not find ant.bat in the path.

  1. Make sure ant is installed on the node where the job is running. (slave or master)
  2. Make sure that the user running the jenkins process/service have ant.bat in PATH. or probably set system path to ant bin.

I can try to help more if you explain your setup. i.e. is it a standalone jenkins server or a distributed environment. What OS is jenkins hosted on (I am assuming windows since you are looking for ant.bat) and how are you trying to invoke ant in the job.

0
votes
  1. set the ANT_HOME in environment variables
  2. add %ANT_HOME%\bin in the PATH this should solve your issue even after setting ANT_HOME if you facing 'ant.bat' is not recognized as an internal or external command restart the Agent/slave , the error will/should disappear.