How to configure remote debugging jar packages using idea
This article mainly introduces how to configure the use of idea remote debugging jar package, has a certain reference value, interested friends can refer to, I hope you can learn a lot after reading this article, the following let Xiaobian take you to understand.
1. Start the project remotely
Configure JVM parameters to run
-Xdebug-Xrunjdwp:transport=dt_socket,suspend=n,server=y,address=$ {debug_port}
Start an example:
Java-Xdebug-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=80-jar demo.jar
Nohup java-Xdebug-Xrunjdwp:transport=dt_socket,suspend=n,server=y,address=8189-Dfile.encoding=utf-8-jar demo.jar > demo.log 2 > & 1 &
-Dfile.encoding=utf-8, but not.
Parameter meaning:
-XDebug enables debugging
-Xnoagent disables the default sun.tools.debug debugger
-Djava.compiler=NONE forbids loading of JIT compiler
-Xrunjdwp loads the JPDA reference execution example of JDWP
Transport is used to communicate between debuggers and processes used by JVM
Dt_socket socket transmission
Whether server=y/n JVM needs to be executed as a debugging server
The port number on which the address=2345 debug server is listening
Whether suspend=y/n starts JVM after the debug client establishes a connection
Note: the-jar parameter cannot be written before the-XDebug parameter
2.idea configuration
Choose to add a Remote, configure debug ip or domain name and port port.
Use module classpath: select a debug module
3.debug start
You can break the mode.
4. Connected successfully
Note: need to ensure consistency between local and remote code
The following error indicates that the jar was not executed or the jar package was not executed successfully, resulting in a failure to connect
Thank you for reading this article carefully. I hope the article "how to configure and use idea to debug jar packages remotely" shared by the editor will be helpful to everyone. At the same time, I also hope you will support us and pay attention to the industry information channel. More related knowledge is waiting for you to learn!