Linux服务器 tomcat 远程调试,

修改 catalina.sh
 # OS specific support.  $var _must_ be set to either true or false.
    cygwin=false
    darwin=false
    os400=false
    case "`uname`" in
    CYGWIN*) cygwin=true;;
    Darwin*) darwin=true;;
    OS400*) os400=true;;
    esac
     
#在此处添加一行,修改address为你自定义的端口号
    JPDA_OPTS="-agentlib:jdwp=transport=dt_socket,address=8111,server=y,suspend=n"
     
    # resolve links - $0 may be a softlink
    PRG="$0"
     
    while [ -h "$PRG" ]; do
      ls=`ls -ld "$PRG"`
      link=`expr "$ls" : '.*-> \(.*\)$'`
      if expr "$link" : '/.*' > /dev/null; then
        PRG="$link"
      else
        PRG=`dirname "$PRG"`/"$link"
      fi
    done


使用catalina.sh jpda start 启动tomcat 服务器


查看服务是否启动成功 netstat -a | grep 8111

tcp        0      0 *:8111                      *:*                         LISTEN


在eclipse中使用 debug进行连接


猜你喜欢

转载自blog.csdn.net/yz972641975/article/details/70578668