Steps to perform remote debugging:
Start the application and tell the JVM that it will be debugged remotely
java -Xdebug -Xrunjdwp:transport=dt_socket,address=8998,server=y -jar myapp.jar
The above command says: start myapp.jar + start a server socket at port 8998 and publish the debugging messages using the Java Debug Wire Protocol (jdwp) there.
Other than address, server, and transport there are other sub options available for -Xrunjdwp option -- for example: suspend. I will leave that for you. Let's move on to step 2, that is configuring Eclipse.