Use remote debugging with 2 consoles - one for the app and another for the jdb. The following link might be of some use for how to do this via a command line app:
debugging - How do I pass console...