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远程调试

  • 相关阅读:
    mysql查看所有的数据库
    查看/杀死mysql进程
    PL/SQL 保存页面布局
    Linux 隐藏文件和目录,显示隐藏的文件和目录
    win10插入U盘多显示了一个盘符
    Linux安装rz和sz命令
    PL/SQL链接Oracle出现乱码
    解决Tomcat: Can't load IA 32-bit .dll on a AMD 64-bit platform问题
    Eclipse集成Tomcat的配置步骤实例
    搭建Eclipse+MyEclipse开发环境
  • 原文地址:https://www.cnblogs.com/winner-0715/p/7995636.html
Copyright © 2011-2022 走看看