File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Ant, Maven and Other Build Tools and the fly likes making ant run using command line Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "making ant run using command line" Watch "making ant run using command line" New topic
Author

making ant run using command line

Samanthi perera
Ranch Hand

Joined: Jan 08, 2010
Posts: 510
How to enable ant to run using command line?
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Type "ant"?

There's nothing special, just make sure the ant executable is on your path.
Samanthi perera
Ranch Hand

Joined: Jan 08, 2010
Posts: 510
I used http://code.google.com/webtoolkit/gettingstarted.html tutorial to run GWT.
I have finished till running the ant devmode command.When i run ant devmode it says


what should i do?IS there any jar files added to classpath?
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

David Newton wrote:[...] make sure the ant executable is on your path.
Samanthi perera
Ranch Hand

Joined: Jan 08, 2010
Posts: 510
How to added ant executable is on path ?
Can you give me a example or tutorials?
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

You don't know how to make your own command line work?! I don't even know what OS you're using.
Samanthi perera
Ranch Hand

Joined: Jan 08, 2010
Posts: 510
I am using Windows Xp now.When a type ant devmode it says
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

So take the few minutes necessary to find out how to add a directory to your path.

It's on the web.
Samanthi perera
Ranch Hand

Joined: Jan 08, 2010
Posts: 510
I have already added ant jar file to to class path
D:\AllJarFiles\antlr-2.7.7.jar
Samanthi perera
Ranch Hand

Joined: Jan 08, 2010
Posts: 510
I also added path variable to D:\AllJarFiles;
Still not working ?
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61206
    
  66

He didn't say classpath.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Samanthi perera
Ranch Hand

Joined: Jan 08, 2010
Posts: 510
please tell me what to do?
Samanthi perera
Ranch Hand

Joined: Jan 08, 2010
Posts: 510
Hay this is not a joke.I need to know urgently,if anyone can tellme i am very gratfull?
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 10102
    
165

Samanthi perera wrote:Hay this is not a joke.I need to know urgently,if anyone can tellme i am very gratfull?


No one is joking. And this is not the right place to ask "Urgent" questions. Everyone here is a volunteer.

By the way, did you even try "set PATH in Windows" in google search?


[My Blog] [JavaRanch Journal]
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 10102
    
165

Jaikiran Pai wrote:

By the way, did you even try "set PATH in Windows" in google search?


Or for that matter, did you even do a google search for the error message you are getting?
Samanthi perera
Ranch Hand

Joined: Jan 08, 2010
Posts: 510
I found one answer
Put an enviornment variable ANT_HOME pointing to your ant folder..
and also append the bin folder of ant to the PATH variable....

But what is anb folder.I only have antlr-2.7.7.jar file.
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 10102
    
165

Samanthi perera wrote:But what is anb folder.I only have antlr-2.7.7.jar file.

...
Samanthi perera wrote:I used http://code.google.com/webtoolkit/gettingstarted.html tutorial to run GWT.


So what does it say in the "Prerequisites" section?
Samanthi perera
Ranch Hand

Joined: Jan 08, 2010
Posts: 510
I added ANT_HOME as D:\software\ant\apache-ivy-2.1.0.

Here is the screen shot of my ant directory

http://4.bp.blogspot.com/_bpkZ2BsqXug/S1QqhlQjlhI/AAAAAAAAAA0/OPN2KT55zKE/s1600-h/ant.bmp

anyway there is no nay folder named bin.

still not working
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16061
    
  21

OK children, playtime's over. We don't want to forget we have a "Be Nice" policy here.

Samanthi, in their own not-so-subtle way, people are saying that we're here to help thinking people, but we're not here to do people's thinking for them. After all, we don't get paid to do this, and some people would be so cynical as to say that when you come in asking such basic questions are these that maybe you're not really well-enough trained to be doing this kind of work. It's unfortunate, but there's a perception that any child can develop professional-grade software, and so some companies figure that they can just hire the cheapest person that comes along regardles of skills or talent. We know better and it causes resentment.

However, we've had our fun, so here's the basics.

Java command-line apps work based on 2 resources. The PATH, which is what the Windows OS uses to locate and execute programs, and the CLASSPATH, which is what the Java Virtual Machine uses to find Java classes and class resources. To run Ant from the command line, you need both.

That usually involves commands that look something like this:



You can set the ANT_HOME and PATH environment settings permanently using the Windows Control Panel. And, no, I'm not supplying further help. The rest is up to you.

Customer surveys are for companies who didn't pay proper attention to begin with.
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Samanthi perera wrote:Here is the screen shot of my ant directory

In the future please cut-and-paste directory trees rather than a screenshot--the linked screenshot is impossible to read.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: making ant run using command line