Need help with btrace?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

4.8K Stars 862 Forks 1.3K Commits 13 Opened issues


BTrace - a safe, dynamic tracing tool for the Java platform

Services available


Need anything else?

Contributors list

Dev build Download huhu Join the chat at Project Stats


A safe, dynamic tracing tool for the Java platform



Quick Summary

BTrace is a safe, dynamic tracing tool for the Java platform.

BTrace can be used to dynamically trace a running Java program (similar to DTrace for OpenSolaris applications and OS). BTrace dynamically instruments the classes of the target application to inject tracing code ("bytecode tracing").


Building BTrace


You will need the following applications installed

  • Git
  • JDKs - JDK 8, Java 9 and Java 11 are required to be available
  • (optionally, the default launcher is the bundled
    wrapper) Gradle

In order to ease the pre-build config the
script is provided. You should run it first as
to automatically download all required JDKs and set up the corresponding
env variables.



Your JAVA_HOME must point to JDK 11 (eg. JAVA11HOME)


./gradlew build
./gradlew buildDistributions

The binary dist packages can be found in

as the *.tar.gz, *.zip, *.rpm and *.deb files. The exploded binary folder which can be used right away is located at
which serves as the BTRACE_HOME location.

Using BTrace


Download a distribution file from the release page. Explode the binary distribution file (either *.tar.gz or *.zip) to a directory of your choice.

You may set the system environment variable BTRACE_HOME to point to the directory containing the exploded distribution.

You may enhance the system environment variable PATH with $BTRACE_HOME/bin for your convenience.

Or, alternatively, you may install one of the *.rpm or *.deb packages


  • /bin/btrace  
    will attach to the java application with the given PID and compile and submit the trace script
  • /bin/btracec 
    will compile the provided trace script
  • /bin/btracer  
    will start the specified java application with the btrace agent running and the script previously compiled by btracec loaded

For the detailed user guide, please, check the Wiki.

Maven Integration

The maven plugin is providing easy compilation of BTrace scripts as a part of the build process. As a bonus you can utilize the BTrace Project Archetype to bootstrap developing BTrace scripts.

Contributing - !!! Important !!!

Pull requests can be accepted only from the signers of Oracle Contributor Agreement

Deb Repository

Using the command line, add the following to your /etc/apt/sources.list system config file:

echo "deb xenial universe" | sudo tee -a /etc/apt/sources.list

Or, add the repository URLs using the "Software Sources" admin UI:

deb xenial universe

RPM Repository

Grab the *.repo file

wget -O bintray-btraceio-rpm.repo
and use it.

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.