点击主窗口菜单 Run / Edit Configurations,打开“Run/Debug Configurations”窗口; 点击工具栏上的“+”按钮,下拉菜单中选择“Remote”; 设置 Host 为远程服务器的域名或IP,保持 Port=5005 无需调整; 复制命令行参数,形如 -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005
jar -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005 -jar test.jar
## sudo vim $CATALINA_HOME/bin/catalina.sh
JAVA_OPTS="$JAVA_OPTS -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005"