zoukankan      html  css  js  c++  java
  • IDEA远程debug的使用

    1、打开配置页面

    2、添加远程调试配置

     

    3、进行参数配置

    不同的jdk版本,配置的参数是不一样的!

     

    其中Host为远程服务器的地址,Port为远程debug的端口,注意要与前面设置的address保持一致。

    配置方式

    apache-tomcat/bin/startup.sh开始处中增加如下内容:

    #!/bin/sh
    # Better OS/400 detection: see Bugzilla 31132
    declare -x CATALINA_OPTS="-server -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=127.0.0.1:60001"
    os400=false
    case "`uname`" in
    OS400*) os400=true;;
    esac
    
    # 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
    
    PRGDIR=`dirname "$PRG"`
    EXECUTABLE=catalina.sh
    
    # Check that target executable exists
    if $os400; then
      # -x will Only work on the os400 if the files are:
      # 1. owned by the user
      # 2. owned by the PRIMARY group of the user
      # this will not work if the user belongs in secondary groups
      eval
    else
      if [ ! -x "$PRGDIR"/"$EXECUTABLE" ]; then
        echo "Cannot find $PRGDIR/$EXECUTABLE"
        echo "The file is absent or does not have execute permission"
        echo "This file is needed to run this program"
        exit 1
      fi
    fi
    
    exec "$PRGDIR"/"$EXECUTABLE" start "$@"

     如果是windows系统,在startup.bat开始处中增加如下内容:

    SET CATALINA_OPTS=-server -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=127.0.0.1:60001

    4、启动远程的tomcat

    5、启动tomcat后,即可在IDEA中运行调试了,如下:

     

    参考:

    idea14和tomcat8远程调试

  • 相关阅读:
    基于ZooKeeper和Thrift构建动态RPC调用
    菜鸡的Java笔记 api 文档
    菜鸡的Java笔记 第二十四
    菜鸡的Java笔记 第二十三
    菜鸡的Java笔记 第二十二
    菜鸡的Java笔记 实践
    Python 函数 参数传递
    python 函数的定义及调用语法,map 方法,函数嵌套递归
    java关键字
    菜鸡的Java笔记 第二十一 final 关键字
  • 原文地址:https://www.cnblogs.com/winner-0715/p/7995636.html
Copyright © 2011-2022 走看看