Are you interested in a byte code instrumentation (BCI) based dynamic tracing solution for the Java platform? If so, please visit https://btrace.dev.java.net. BTrace is a safe, dynamic tracing solution for Java. You can express tracing code in Java and run it against a running Java application. Your Java application should be running on JDK 6 or above for BTrace to work. You may be using VisualVM, the all-in-one Java troubleshooting tool. VisualVM supports plugin model to extend it's capabilities. BTrace plugin for VisualVM will be available soon. When BTrace plugin is available, you can trace your application from VisualVM tool. In the meanwhile, you can use BTrace command line tools.
You may want to check out the user guide for the command line access.