use java debug interface trace method , fields and local variable
enviroment java1.7(may be java 1.6 , i have not give it a trial)
example first run https://github.com/maokitty/JVMQuery/blob/master/src/test/java/tp/jdi/AppTarget.java with options: -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=9999 then run https://github.com/maokitty/JVMQuery/blob/master/src/test/java/tp/jdi/AppTarget.java