Find your content:

Search form

You are here

The term 'ant' is not recognized as the name of a cmdlet, function, script file , or operable program

 
Share

I am working on Salesforce Touch; I am new with this platform. I am referring to the Salesforce Touch guide. I am trying to create a native Android project, using this command

ant create_native -Dapp.name={DemoApp} -Dtarget.dir={C:\Anu Raj\project\Salesforce Touch} -Dpackage.name={com.acme.mobileapp}"  

but i am getting this error while doing this --- > "

The term 'ant' is not recognized as the name of a cmdlet, function, script file
, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:4
+ ant <<<<  create_native -Dapp.name={DemoApp} -Dtarget.dir={C:\Anu Raj\project
\Salesforce Touch} -Dpackage.name={com.acme.mobileapp}
    + CategoryInfo          : ObjectNotFound: (ant:String) [], CommandNotFound
   Exception
    + FullyQualifiedErrorId : CommandNotFoundException"

can anybody tell me what is the issue for this.


Attribution to: AnuRaj

Possible Suggestion/Solution #1

This is probably because its not able to find the ant executable in your Path. I'm assuming you've installed Apache Ant. (http://ant.apache.org/bindownload.cgi)

Assuming you're on Windows, you need to set your ANT_HOME and add the ant bin to your PATH environment variable

So My Computer > Proprties > Advanced System Settings > Environment Variables

Add a new Variable called ANT_HOME Set the value to be the base directory of your apache ant installation, eg :

ANT_HOME Environment Variable

Then add the location of the ANT Bin directory to your PATH Variable, which will already exist. eg : Add ;C:\apache-ant-1.8.4\bin to the end of the PATH System Variable

Set the ANT bin directory to your PATH Environment Variable

After you've done this, you will need to launch a new command window and then ant can be used.

Even now, ant will work if you explicitly navigate to the Ant Installation's bin directory and type ANT.


Attribution to: techtrekker
This content is remixed from stackoverflow or stackexchange. Please visit https://salesforce.stackexchange.com/questions/4386

My Block Status

My Block Content