- 运行程序处->Edit Configurations,如下图
- 添加->Remote Jvm Debug
- 粘贴下图中command line arguments追加至你的java启动命令,host为远程服务器地址,端口即参数中指定的端口号,保持一致。
- 启动脚本参考
nohup java -jar -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=35005 -Djava.rmi.server.hostname=172.20.62.117 -Dcom.sun.management.jmxremote=true -Dcom.sun.management.jmxremote.port=33346 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Xss512k -Xmx4g -Xms4g -XX:+UseG1GC -XX:G1HeapRegionSize=4M -Xloggc:log/gc-%t.log -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=14 -XX:GCLogFileSize=100M -Dspring.profiles.active=dev *.jar > log/qw-daily.log 2>&1 &