Ant is mainly used for building, not for Java applications.
But I'm sure you are using your application using Ant Java .
Ant Java Task
If so, then you can do this using remote debugging.
Remote Debug Java Application
In fact, you can debug any Java application like this.
Applications running through Ant are still Java .
source share