title: Ant build executes cordova
body: <p>I created an ant build for my cordova project as following:</p>
  
  <pre><code>&lt;project default="build"&gt;
      &lt;target name="init-android"&gt;
          &lt;exec executable="cordova"&gt;
              &lt;arg value="platform"/&gt;
              &lt;arg value="add"/&gt;
              &lt;arg value="android"/&gt;
          &lt;/exec&gt;
          &lt;exec executable="cordova"&gt;
              &lt;arg value="build"/&gt;
          &lt;/exec&gt;
      &lt;/target&gt;
  &lt;/project&gt;
  </code></pre>
  
  <p>But I got this error:</p>
  
  <blockquote>
    <p>C:\path_to_project\build.xml:3: Execute failed: java.io.IOException:
    Cannot run program "cordova": CreateProcess error=2, The system cannot
    find the file specified
            at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029)
            at java.lang.Runtime.exec(Runtime.java:615)
            at org.apache.tools.ant.taskdefs.launcher.Java13CommandLauncher.exec(Jav
    a13CommandLauncher.java:41)</p>
  </blockquote>
  
  <p>I can run cordova command with no problem from the command prompt, I have:</p>
  
  <blockquote>
    <p>JAVA_HOME = C:/Program Files/Java/jdk1.7.0_10/ 
    ANT_HOME = C:\Program Files\Java\apache-ant-1.9.2 
    NODEJS_HOME = C:\Program Files\nodejs</p>
  </blockquote>
  
  <p>and they are all in my path. I don't understand why it doesn't work. Please help. Thanks</p>