Friday, June 5, 2009

How to setup Apache Ant for remote debugging

If you want to debug some java application which is run from Apache Ant script using java task you should add the following jvmarg:

<jvmarg value="-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005" /
>

Ant script will look like this:

<java classname="test.Main">
<jvmarg value="-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005" />
<classpath>
<pathelement location="dist/test.jar"/>
</classpath>
</java>

For more information on
JPDA options see: How to setup Apache Tomcat for remote debugging