As long as you’re using a java application (ie an application calling your JVM), you can enable the debug mode with these parameters :
-Xdebug -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=y
So for example, if you want to debug an ant launch (launched via « ant -f myBuild.xml » for example), you simply have to set ANT_OPTS; on windows :
set ANT_OPTS=-Xdebug [...]

