How to debug a .jar file remotely using Intellij Idea
I am currently using intellij idea to code my project that I am working on, after creating of .jar file using OneJar command i deploy the .jar file on my linux server who address is something like 22.214.171.124.there I run the command sudo nohup java -jar fileName.jar & on server to start the jar file in the background and use the rest-client app to send rest calls to my .jar file.Whenever something goes wrong I can only see error message in nohup.out file and what I actually wanted is to debug my jar file using intellij idea i.e how can I debug my .jar running on 126.96.36.199 using intellijIdea running on my client machine.I know I have to use that EditConfigurations option in run menu of intellij and provide IP and Port, but how to do it exactly.
You must run the remote "java -jar .." command in debug mode by adding the additional magic flags. You can then tell your local IntelliJ to create a new debug configuration targeting a remote application - IntelliJ provides the magic flags you need.
The help page for this feature is at https://www.jetbrains.com/idea/help/run-debug-configuration-remote.html