A: 

What is the error?

Maybe this is out of the scope of your question but have you ever thought about Continuous Integration solutions? We use LuntBuild and are quite happy (other alternatives exist as well: CruiseControl, Hudson, QuickBuild).

Alexandru Luchian
A: 

Check to make sure you're using the same version of the JDK in both Eclipse and from Ant. Perhaps this is a difference across JDK versions?

The only other option would be that it's a difference in parameters being passed to javac.

I'm betting it's the former, not the latter.

Jared
A: 

Having an empty (package) directory would not cause an error. Make sure the (root) directory of that package hierarchy is being added to the classpath specifed for javac.

eg. if the package is com.stuff and the directory is /java/src/com/stuff then you need to add /java/src to the javac classpath.

Or just remove the import, if it is importing .* from an empty directory then it is redundant.

objects
A: 

For building Eclipse projects outside of Eclipse, have a look at the ant4eclipse project.

Thorbjørn Ravn Andersen