The order of the and tags within a is ignored when the FileSet is created. Instead, all of the elements are processed together, followed by all of the elements. This means that the elements only apply to the file list produced by the elements. To get the files you want, focus on just the patterns that would be necessary to get them. If you find you need to trim the list that the elements produce, then use elements. ant failed to build my program via javac even when I put the needed jars in an external build.properties file and reference them by pathelement or classpath refid. When ant loads properties from an external file it doesn’t touch the value of properties, trailing blanks will not be trimmed for example. If the value represents a file path, like a jar needed to compile, the task which requires the value, javac for example would fail to compile since it can’t find the file due to