When launching the process you want to attach the debugger to, type -Xdebug in the Java virtual machine's parameter list (after -classic when running on Hotspot) and note the agent password.
From the main window, choose Debug Attach to VM.
In the Attach to VM dialog box, type the IP address and password of the host machine.
Click OK.
The debugger connects to the running virtual machine, and you will
see threads as if you were debugging locally. If you set a breakpoint
in the source code, the
Source Editor opens with the breakpoint line highlighted in
red.