I’ve been trying to connect jdb to the android emulator for a little while, and have been met repeatedly with:
jdb -sourcepath ./src -attach localhost:8700
java.
Try quitting Android Studio.
I had a similar problem on the Mac due to the ADB daemon already running. Once you quit any running daemons, you should see output similar to the following:
$ adb -d jdwp
28462
1939
^C
$ adb -d forward tcp:7777 jdwp:1939
$ jdb -attach localhost:7777 -sourcepath ./src
Set uncaught java.lang.Throwable
Set deferred uncaught java.lang.Throwable
Initializing jdb ...
>
See my other answer to a similar question for more details and how to start/stop the daemon.