views:

25

answers:

2

hi,

i need to add a folder in current classpath for ant script that i have written for running java files.

please help me.

A: 

You could add it as an attribute

<java classpath="${extraDir}"
      classname="pkg.Class">
      ...
</java>

Or using the nested <classpath> tag:

<java classname="pkg.Class">
  <classpath>
    <pathelement path="${extraDir}"/>
  </classpath>
</java>

See the documentation for the Java task.

aioobe
@aioobe: actually i hv some xml files, which i hv placed them all in a folder, if i trying to gv the folder path, then also ant is unable to pick it up.
Mrityunjay
You should probably look into the [import task](http://ant.apache.org/manual/Tasks/import.html)
aioobe
A: 

i added the following line in the tag of the task and it ran successfully.

<pathelement path="C:\JunitTest\folderIsHere"/>

and after this the script ran successfully.

Mrityunjay