How to debug Java code when using ANT script in Eclipse

后端 未结 8 1863
南笙
南笙 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 13:00
    set ANT_OPTS=%ANT_OPTS% -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5432
    

    in Eclipse

    Toolbar >> Run >> Debug Configurations >> + >> 
    

    Give the values:

    Name: Debug_Ant
    Project: active-eclipse-project
    Host:localhost
    Port:5432
    
    0 讨论(0)
  • 2020-12-04 13:06

    Steps:

    1)Configure remote java debugger with local host as name, port address as 8000(or whatever your system's port address will be)

    2)Create a batch file and keep that in bin folder of your tomcat(this step is required when we want to debug remotely keeping server/s in same system).

    in batch file you should keep this line:

    set JPDA_ADDRESS=8000

    set JPDA_TRANSPORT=dt_socket

    catalina.bat jpda start

    after this keep a break point in your java code, and debug this remote debugger. it will work.

    Happy Coding !!

    0 讨论(0)
提交回复
热议问题