How to debug Java code when using ANT script in Eclipse

后端 未结 8 1902
南笙
南笙 2020-12-04 12:43

I have a java class and I need to debug it (put breakpoints and continue using F6). I am using ANT script to init, build, deploy and run the code. I am using:



        
8条回答
  •  [愿得一人]
    2020-12-04 12:57

    This is to help the people who are wondering how to debug the web application that use ant to build and deploy. This is quite frequent in legacy applications. If the project was started as "Dynamic Web Project" as the beginning, following steps and even Ant is not necessary.

    Set the break point in your code.

    Window -> Show View -> Others -> Servers
    

    Add your server JBoss or Tomcat for example.

    Right click on the server and choose 'Debug'.

    Make sure that debug="true" is set in ant build file.

提交回复
热议问题