Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jdt-debug-dev] Debug application in Eclipse started by ANT



You will need to specify in your Ant buildfile to launch the Java
application in a debug mode that the Eclipse debugger can attach to.

Steps:
Specify the jvmargs as shown in this example:

      <target name="remoteJava" description="Launches a Java program for
remote debug">
            <java
                  classname="samples.example.Run"
                  classpath="${project_dir}/bin"
                  fork= "true">
                  <jvmarg value="-Xdebug"/>
                  <jvmarg value="-Xnoagent"/>
                  <jvmarg value="-Djava.compiler=NONE"/>
                  <jvmarg
value="-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000"/>
            </java>
      </target>

Create a Remote Java  Application launch configuration
      Run>Debug>Remote Java Application> New
      Set the correct port (see the jvmarg with address above)
      Set the appropriate project (or just set up the Source lookup as you
desire)
Set your breakpoints
Run the Ant build (it will pause waiting for the debugger to connect)
Debug the Remote Java Application launch configuration

HTH
Darins



|---------+------------------------------->
|         |           jan.lavrijsen@philip|
|         |           s.com               |
|         |           Sent by:            |
|         |           jdt-debug-dev-admin@|
|         |           eclipse.org         |
|         |                               |
|         |                               |
|         |           08/15/03 07:33 AM   |
|         |           Please respond to   |
|         |           jdt-debug-dev       |
|         |                               |
|---------+------------------------------->
  >------------------------------------------------------------------------------------------------------------------|
  |                                                                                                                  |
  |       To:       jdt-debug-dev@xxxxxxxxxxx                                                                        |
  |       cc:                                                                                                        |
  |       Subject:  [jdt-debug-dev] Debug application in Eclipse started by ANT                                      |
  |                                                                                                                  |
  >------------------------------------------------------------------------------------------------------------------|





Hello all,

We're having an application that can only be started (normally) by using an
ANT build script, because the ANT scripts fills in some important tags into
the Java code. Now we would like to debug the application (run until a
breakpoint), but it seems not possible to start the ANT script (and so, the
application) in debug mode.

Can somebody give some help or advice?

Thanks in advance!

Greetings,
Jan




Back to the top