ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject Re: Running java program in debug mode
Date Wed, 23 Aug 2006 19:01:12 GMT

Hi Antoine,
 It worked ! Yes this way i was able to debug my programs launched using
Ant . Thanks ! I was trying to get this one working for last few days..
Have a nice day,

             08/23/2006 02:13                                           To 
             Please respond to                                     Subject 
             user@ant.apache.o         Re: Running java program in debug   
                    rg                 mode                                

Hello Vinod,

use these arguments :

-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=1044

and create a remote debugging configuration in Eclipse, using the same port
1044 (can be another number as long as it is the same to start java and in

Also add something like
in your main method,
so that you have the time to connect to your program from within Eclipse
after you have started it.

The sequence of operation is :

create the remote debugging configuration in eclipse
start ant
when ant reaches the point where your Helloworld program starts executing,
start the debugging in Eclipse. You know that it works when Eclipse
displays a message like "connected with remote VM". You will then see in
the editor that you are at the line of code saying Thread.sleep.

You can then debug "normally".

Good luck.


-------- Original-Nachricht --------
Datum: Wed, 23 Aug 2006 08:35:50 -0400
Betreff: Running java program in debug mode

> Hi All,
>       I created a Java project with a HelloWorld  java program . I use
> to build and run it.It runs fine.But when i want to run using eclipse
> debugger It did not stop at break points to let me step through the
> program.
> <target name="compile" depends="init"
>         description="compile the source " >
>     <!-- Compile the java code from ${src} into ${build} -->
>     <javac srcdir="${src}" debug="true" destdir="${build}"/>
> </target>
> <target name="run" depends="init" description="Run the java remote
> >
>   <java dir="." classname="com.test.HelloWorld" fork="yes"
> failonerror="yes" >
>    <sysproperty key="DEBUG" value="true"/>
>    <jvmarg value="-Xdebug"/>
>    <jvmarg value="-Xnoagent"/>
>    <jvmarg value="-Djava.compiler=none"/>
>    <classpath>
>    <pathelement location="${dist}/lib/MyProject-${DSTAMP}.jar"/>
>     </classpath>
>   </java>
> </target>
> Please help me to make the necessary changes in my script , so i can
> standalone java programs also.
> Thanks for the help.
> Regards,
> Vinod

To unsubscribe, e-mail:
For additional commands, e-mail:

This communication may contain privileged and/or confidential information. It
is intended solely for the use of the addressee. If you are not the intended
recipient, you are strictly prohibited from disclosing, copying, distributing
or using any of this information. If you received this communication in error,
please contact the sender immediately and destroy the material in its entirety,
whether electronic or hard copy. This communication may contain nonpublic personal
information about consumers subject to the restrictions of the 
Gramm-Leach-Bliley Act. You may not directly or indirectly reuse or redisclose
such information for any purpose other than to provide the services for which
you are receiving the information.

127 Public Square, Cleveland, OH 44114

If you prefer not to receive future e-mail offers for products or services from
Key send an e-mail to with 'No Promotional E-mails' in the

  • Unnamed multipart/related (inline, None, 0 bytes)
View raw message