当前位置:网站首页>远程调试 idea配置remote debug、在远程服务器的程序中,添加JVM启动参数-Xdebug
远程调试 idea配置remote debug、在远程服务器的程序中,添加JVM启动参数-Xdebug
2022-07-27 20:45:00 【但行益事莫问前程】
前言
在本地开发的程序运行在服务器上报错且缺少日志信息甚至没有错误日志时,需要通过远程调试来调试服务器上的程序
1. idea配置remote debug
1.1 在服务器的程序中,添加JVM启动参数
在启动程序的脚本中,即java -jar命令后,添加支持远程调试的参数(默认选择5005端口,为避免端口冲突,可选用其他不常用端口)
-Xdebug -Xrunjdwp:transport=dt_socket,address=5005,server=y,suspend=n
参数含义:
-XDebug 启用远程调试
-Xrunjdwp 加载JDWP的JPDA参考执行实例
transport 用于在调试程序和VM使用的进程之间通讯
dt_socket socket传输
server=y/n VM是否需要作为调试服务器执行
address=5005 调试服务器监听的端口号
suspend=y/n 是否在调试客户端建立连接之后启动VM
如:
1.2 idea连接远程服务器,进行远程调试
点击Add Configuration后选择Remote
设置远程服务器的Ip和远程调试的端口
在本地代码中添加断点后,即可调试远程服务器上代码

注:
若远程服务器和本地之间防火墙未打开,则无法进行远程调试,可通过telnet ip 端口命令测试通信
2. 远程调试原理
Java程序统一以字节码的形式在JVM中运行,只要本地代码和远程服务器上的类文件相同,两个JVM通过调试协议进行通信,本地的源码就可以连接到远程服务器上的JVM,进而执行远程调试
边栏推荐
- 【GNN报告】加拿大蒙特利尔唐建:Geometric Deep Learning For Drug Discovery
- 常用泰勒展开
- 360 was selected into the panorama of China's security industry, and isc2022 talked about the direction of security services in 63 fields
- 记录一下使用R语言中关于formatC的错误
- 华为鸿蒙 3 正式发布,这个安全功能解决了一大痛点
- "The faster the code is written, the slower the program runs."
- 【StoneDB故障诊断】数据库实例crash
- Nature review: preferential effects in the formation of microbial communities
- 微信安装包11年膨胀575倍,UP主:“98%的文件是垃圾”;苹果应用商店被曝大量色情App;四大科技巨头呼吁废除闰秒|极客头条
- ELK日志分析系统安装和部署
猜你喜欢

Lanproxy映射本地开发环境

【信号去噪】基于卡尔曼滤波实现信号去噪附matlab代码

AWS DynamoDB运用技巧

Preliminary understanding of Panda3D audio and advanced interactive components

QT with OpenGL(Shadow Mapping)(平行光篇)
![[signal denoising] signal denoising based on Kalman filter with matlab code](/img/9e/9e569c83dc3106570cf7571056867f.png)
[signal denoising] signal denoising based on Kalman filter with matlab code

Read an article to understand artificial neural network
Software test function test full set of common interview questions [function test] interview summary 4-2
![[number recognition] recognize 0-9 numbers based on Hopfield neural network with matlab code](/img/10/de712b67a7538be03f8fb722271949.png)
[number recognition] recognize 0-9 numbers based on Hopfield neural network with matlab code

营收、利润两位数增长,华润怡宝悄悄打造了这些过亿新品
随机推荐
许锦波:AI蛋白质预测与设计
Jsonpath: a powerful rule parsing and parameter lookup tool for JSON
With double-digit growth in revenue and profit, China Resources Yibao has quietly created these new products worth more than 100 million
Pentium fast system call learning
[number recognition] handwritten number recognition based on knowledge base with matlab code
Cloudcompare & PCL platform convex hull method to calculate crown volume
After returning to mixlab for three days, "creative team" cured my spiritual internal friction
【GNN报告】加拿大蒙特利尔唐建:Geometric Deep Learning For Drug Discovery
Introduction to the paper | distributed graph simulation
helm chart详解及常用命令:helm template / package / plugin
迪赛智慧数——其他图表(平行坐标图):家庭未来资产配置意愿
新技术引领大中型企业营销新变革,用友BIP CRM重磅发布!
[GNN report] Tang Jian, Montreal, Canada: Geometric deep learning for drug discovery
Normality of confidence interval
钉钉报警工具
低代码开发前景如何,大家都真的看好低代码开发吗?
【ELM分类】基于核极限学习机和极限学习机实现UCI数据集分类附matlab代码
The wechat installation package has expanded 575 times in 11 years, and the up owner: "98% of the documents are garbage"; Apple App store was exposed to a large number of pornographic apps; Four techn
一加将在2020年释放ODM订单,发力中低端市场
C#委托用法--控制台项目,通过委托实现事件