Probably could have chosen something a little easier for your first build.xml
To answer your question about dynamically getting the filenames, you need to use a fileset, filelist, or path.
Gives you a list of all the files that end in .java (inc subdirs), in the dir specified by my.load.java.files.dir
Now, I anticipate your next question will be
how do I loop in ant? (unless of course, loadjava can take a whole list of java files separated by ;, in which case you're done). Ant doesn't come with any looping facility, so you have to turn elsewhere for that.
Get ant-contrib from
http://ant-contrib.sourceforge.net Then you can do something like (and this almost a free answer, and should be enough to get you going)
Where the target loadjava is defined pretty much how you have it, you have the it somewhat wrong,
you should be using the exec task which has nested arg elements. Each arg element is a single parameter, so you would have 4 nested arg elements, one each for "-thin" "-user" "scott/tiger@localhost:1522:TNSNAME" and "xyz.java"
Mileage may vary depending on whether loadjava is a batch file or not when using exec (the ant docs tell you why)- in fact, unless you are set on learning ant, then I would have written a batch file to do this, if I'm not mistaken you could have something like :-
Which is both shorter, and less well documented, thus keeping you in a job while you do something more interesting
Lewin