• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Error in a simple build file

 
ramya narayanan
Ranch Hand
Posts: 338
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear all,
I'm a novice in using ant tools & this is my first build.xml.
I've written a simple build file, to have all my class files
from
C:\Sai\src to E:\Sai\Classes.
This is my build.xml



When I run this using the ant tool:

Why this is happening & how it could be rectified?
M'wile what is the meaning of $ we use in ${src}.

configuration details:


ANT_HOME -> C:\Ant16 (Ant version: 1.6)
path -> JAVA_HOME\bin;ANT_HOME\bin;
classpath-> JAVA_HOME\lib;


Regards.
 
Martijn Verburg
author
Bartender
Posts: 3275
5
Eclipse IDE Java Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You've declared the default target as dist at the top of your build.xml which is then the target that Ant will call if you do not provide it with a specific one. As that target does not exist in your build.xml you get the error. Try changing default to nothing or "compile" if that's what you want to happen by default.

The usage of ${} notation is simply how you reference properties in Ant. So ${src} will be replaced by the property src (which in your case is C:\Sai\src)
 
ramya narayanan
Ranch Hand
Posts: 338
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear all,
See now I've removed the dist property & I've modified my source & target directories also.
But eventhough the build is successful, the class files are not there in my target folder i.e. C:\buildoutput\classes


In building:

Regards
 
Martijn Verburg
author
Bartender
Posts: 3275
5
Eclipse IDE Java Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there,

Try "ant compile" so that the compile target gets called explicitly
 
ramya narayanan
Ranch Hand
Posts: 338
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear Martijn Verburg ,
Now it's working fine as suggested by you.
Now we've put our class file in c:\buildoutput\classes.
Is it possible to run these classes using ant.
How?
Regards
 
Martijn Verburg
author
Bartender
Posts: 3275
5
Eclipse IDE Java Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ramya, yes it is, see the Java task in the Ant documetnation.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic