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

  • 相关阅读:
    详解Android Intent
    【JAVA EE企业级开发四步走完全攻略】
    撼动IT界的10大编程语言
    System.getProperty() 常用值
    Android List,Adapter相关
    为程序员量身定制的12个目标
    java 算法数据
    JAVA基础之理解JNI原理
    Java 工厂模式
    linux下C语言读取网卡MAC地址
  • 原文地址:https://www.cnblogs.com/winner-0715/p/7995636.html
Copyright © 2011-2022 走看看