码迷,mamicode.com
首页 > Windows程序 > 详细

Tomcat配置远程调试端口(windows、Linux)

时间:2017-09-17 22:50:11      阅读:274      评论:0      收藏:0      [点我收藏+]

标签:pre   tran   inux   one   打开   clip   使用方法   connect   span   

  当我们需要定位生产环境问题,而日志又不清晰的情况下,我们可以借助Tomcat提供的远程调试,设置如下:

// Linxu系统: apach/bin/startup.sh开始处中增加如下内容: 
declare -x CATALINA_OPTS="-server -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8081"


// Windows系统: apach/bin/startup.bat开始处中增加如下内容:
SET CATALINA_OPTS=-server -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8081

  linux打开端口命令的使用方法: nc -lp 8081 &(打开8081端口) 

  linux查看是否打开8081端口: netstat -an | grep 8081

  注:linux下1010端口是默认开的,可以直接设置为调试1010端口即可。


  Eclipse中配置debug>>Debug Configurations>>Java Remote Application:

        技术分享

启动成功之后Disconnect按钮会被点亮。

          技术分享

Tomcat配置远程调试端口(windows、Linux)

标签:pre   tran   inux   one   打开   clip   使用方法   connect   span   

原文地址:http://www.cnblogs.com/jing99/p/7538291.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!