zoukankan      html  css  js  c++  java
  • Java项目远程调试

    准备一个项目

    比如我有个SpringBoot项目

    打包好,上传服务器

    服务器

    1. 开启端口(8080是项目端口,8000是远程调试端口)

    [root@localhost app]# firewall-cmd --zone=public --add-port=8080/tcp --add-port=8000/tcp --permanent
    success
    [root@localhost app]# systemctl restart firewalld

    2. 运行jar包

    [root@localhost app]# java -Xdebug -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n -jar simple-web-0.0.1-SNAPSHOT.jar

    IDEA打断点

    先配置

    点击+号,选择Remote

    填上名称,服务器IP和调试端口

    OK

    运行

    这个时候,打个断点,然后请求服务器,就会进入本地IDEA

    到此结束,其实核心就是在启动的时候加上相关JVM参数

  • 相关阅读:
    简单记录下springboot+jms+activemq
    简单记录下RestTemplate 中postForObject调用例子
    vue+springboot后台实现页面按钮权限
    发送短信功能
    drf
    drf
    drf
    drf
    drf
    drf
  • 原文地址:https://www.cnblogs.com/LUA123/p/13456350.html
Copyright © 2011-2022 走看看