Tomcat7 Debug run in ecplise

Remote debugging with Tomcat (7) and Intellij        

It took me a while to find out how to set up Tomcat 7 to allow for remote debugging from Intellij, so I decided to put the process up here for my own future reference and hopefully for other people's convenience. This small tutorial is aimed at Windows users, but it shouldn't be too difficult to figure out how to do it on Linux.

Configuring Tomcat 7

Follow these steps to configure Tomcat.

  1. Go to your Tomcat installation directory and then into the bin folder.
  2. Create a new file called setenv.bat. (This file will be automatically read by catalina.bat)
  3. Add the following content to setenv.bat: 

    set CATALINA_OPTS="-agentlib:jdwp=transport=dt_socket,address=8000,server=y,suspend=n"

    I chose the default port number for remote debugging, which is 8000, but you can choose any port number you like.
  4. Now start Tomcat normally, using startup.bat. The first thing Tomcat should tell you is that it is listening on port 8000.

    Tomcat listening for debugging

Now that Tomcat is ready for debugging let's see how to create a debugging configuration in Eclipse and Intellij.

 

Ecplise

1.Open Debug Dialog

Remote Java Application

 

new Project :

 

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值