Reputation: 1237
I'd like to attach NetBeans to a Java program I'm writing to help with debugging. I've added a "debug" target to my ant file with the expectation that this will launch the debugger on port 54322 where NetBeans could then attach. This has worked at some point in the past, but meanwhile I must have messed something up. Can anyone try and help find my error in the syntax?
ant debug
will simply start the program, no debugger starts. After the program ends, this is printed in the terminal:
build.xml:55: Problem: failed to create task or type jvmarg
Cause: The name is undefined.
In the compile task, I've included the debug options:
<javac srcdir="${src.dir}" destdir="${classes.dir}" includeantruntime="false" debug="true" debuglevel="lines,vars,source">
Here's the "debug" task (including line numbers). You see line 55 is where ant complains about an undefined name.
53 <target name="debug" depends="jar">
54 <java jar="${jar.dir}/${ant.project.name}_ClearText.jar" fork="true"/>
55 <jvmarg line="-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=54322" />
56 </target>
Upvotes: 1
Views: 1793
Reputation: 72884
jvmarg
must be nested inside the java
task call:
<target name="debug" depends="jar">
<java jar="${jar.dir}/${ant.project.name}_ClearText.jar" fork="true">
<jvmarg line="-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=54322" />
</java>
</target>
Upvotes: 2