Follow the below steps to perform the remote debugging in Intellji Idea IDE
1. Start the java application with the below Java options
-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=9995 Ex: java -jar -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=9995 application.jar
Here “application.jar” is the actual jar file which we have
2. Open up the Intellji Idea IDE and click on Run ➝ Edit Configuration, then Select Remote and click on + sign on the menu bar. It will open up a Remote Debug config window. Just change the port number to 9995 and Host accordingly and click on “Apply” and “OK”
3. Open up the Run window, you will see the “Debug “Remote”” option. When you click on it, you will be going to remote debug mode.
4. Then Put up some break points in your code.
5. Access the application from the browser or by running any process
6. The remote process will get started and it will be stopped at the break point. You can continue with the debugging process from there with all the debug options