How can we debug a code in intellij which is present on a remote server?

I am developing a Jira-plugin. But my environment is set up on a remote server. How can I debug it on my local intellij.

1 Like

You first need to start your remote server with debug port open (5005 for example) by set these arguments for JVM (put into the setenv.bat (Windows) or setenv.sh (Linux)):

set JVM_SUPPORT_RECOMMENDED_ARGS=-Xdebug -Xrunjdwp:transport=dt_socket,address=5005,server=y,suspend=n

Then create a remote debug in your IntelliJ as you will do for local server, but point the host to your server:

5 Likes

Hi @nhac.tat.nguyen, I followed these steps here in my intellij which are almost similar to yours, and hosted the application on remoter server using atlas-debug. Now whenever I run debug in my intellij it gets started but how can I use the debug functionality further i.e. stopping at a breakpoint and checking my variables etc.

and hosted the application on remoter server using atlas-debug

This is also working (it will open the debug port 5050 for ya).

Now whenever I run debug in my intellij it gets started

Do you see the text Connected to the target VM, address: '[your-host]:5005', transport: 'socket' when you start the debug?

yes @nhac.tat.nguyen.

If yes, create some breakpoints, and do something in your Jira instance which will execute your code. Everything should work now, and your code will stop whenever it reaches the breakpoint.
No further step needed.

1 Like

Thanks @nhac.tat.nguyen, It’s working now.