The JVM has a debugger built into it. That means that ANY java app can be debugged - JAR, WAR,
applet,
servlet, whatever.
The mechanism works courtesy of a standard debugging protocol and a network debugging port. In other words, the JVM acts as a debugging
server. You define the port number when you start the JVM. One popular port number is 8000, but there's no standard port. You can use any one you like, as long as no other app is using it.
Remote Debugging is the process of connecting a remote debugging client (such as Eclipse) to the debugging server. One of the options that the JVM has is that it can either halt the application on startup and wait for the client to connect and resume execution, or it can start in the normal way and the client can connect (and disconnect) any time it wants to.
The secret of how to be miserable is to constantly expect things are going to happen the way that they are "supposed" to happen.
You can have faith, which carries the understanding that you may be disappointed. Then there's being a willfully-blind idiot, which virtually guarantees it.