I am sorry, I am a Mac user and don’t know exactly how it is on Windows.
But, I think adb command line is available on windows (http://www.herongyang.com/Android/Debug-adb-logcat-Command-Display-System-Log.html) and in general, it is possible to execute shell commands in Java (http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/Runtime.html). Sorry, this is how I would start to solve it but as mentioned, I use Mac and do it via command line directly and not via code.