This week's book giveaway is in the Testing forum.
We're giving away four copies of Practical Unit Testing with TestNG and Mockito and have Tomek Kaczanowski on-line!
See this thread for details.
The moose likes Ant, Maven and Other Build Tools and the fly likes ant command, java command Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of Practical Unit Testing with TestNG and Mockito this week in the Testing forum!
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Reply Bookmark "ant command, java command" Watch "ant command, java command" New topic
Author

ant command, java command

Anonymous
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
A novice at using Ant, I am attempting to use the "ant" command, and instead am getting a list of java options one would get when using the "java" command with no options. In other words, when I enter "ant" and return, the result is the same as if I enter "java" and return. Any idea what might be causing this apparent mixup between ant and java? I have tried quite a few different things, and am stumped. I even moved the build.xml file etc into the apache\bin directory, and am getting the same result. Your help is much appreciated.
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

Ant is a Java application. Its is run by calling ant.bat (on Windows anyway). If you open up ant.bat you'll see the java command that is actually being called. There are a bunch of options and variables which should be set. I would presume that java is complaining becuase one of these options isn't set (unless you have editied ant.bat?). The obvious one which the documentation tells you to set is ANT_HOME. Make sure this is set.


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
Anonymous
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
Paul, thanks for your response. Soon after posting my message yesterday, I discovered that ant.bat was inserting a "\" in one of the filepaths that I was not expecting; this conflicted with one of my filepaths in an environment variable I created, so the filepath ant used had a "\\".
 
 
subject: ant command, java command
 
Threads others viewed
Tools.jar does not exist.Also where to create the build.xml file?
how to execute ejb3.0
ant command, java command
problem with ant scp and sshexec tasks
weblogic.jspc thru command line(not thru ANT)
IntelliJ Java IDE