How To Install byteman on Fedora 34

byteman is Java agent-based bytecode injection tool

Introduction

In this tutorial we learn how to install byteman on Fedora 34.

What is byteman

Byteman is a tool which simplifies tracing and testing of Java programs. Byteman allows you to insert extra Java code into your application, either as it is loaded during JVM startup or even after it has already started running. The injected code is allowed to access any of your data and call any application methods, including where they are private. You can inject code almost anywhere you want and there is no need to prepare the original source code in advance nor do you have to recompile, repackage or redeploy your application. In fact you can remove injected code and reinstall different code while the application continues to execute.

We can use yum or dnf to install byteman on Fedora 34. In this tutorial we discuss both methods but you only need to choose one of method to install byteman.

Install byteman on Fedora 34 Using dnf

Update yum database with dnf using the following command.

sudo dnf makecache --refresh

The output should look something like this:

Fedora 34 - x86_64                               20 kB/s | 6.6 kB     00:00
Fedora 34 openh264 (From Cisco) - x86_64        1.4 kB/s | 989  B     00:00
Fedora Modular 34 - x86_64                       68 kB/s | 6.5 kB     00:00
Fedora 34 - x86_64 - Updates                    3.5 kB/s | 6.2 kB     00:01
Fedora Modular 34 - x86_64 - Updates             17 kB/s | 5.9 kB     00:00
Metadata cache created.

After updating yum database, We can install byteman using dnf by running the following command:

sudo dnf -y install byteman

Install byteman on Fedora 34 Using yum

Update yum database with yum using the following command.

sudo yum makecache --refresh

The output should look something like this:

Fedora 34 - x86_64                               20 kB/s | 6.6 kB     00:00
Fedora 34 openh264 (From Cisco) - x86_64        1.4 kB/s | 989  B     00:00
Fedora Modular 34 - x86_64                       68 kB/s | 6.5 kB     00:00
Fedora 34 - x86_64 - Updates                    3.5 kB/s | 6.2 kB     00:01
Fedora Modular 34 - x86_64 - Updates             17 kB/s | 5.9 kB     00:00
Metadata cache created.

After updating yum database, We can install byteman using yum by running the following command:

sudo yum -y install byteman

How To Uninstall byteman on Fedora 34

To uninstall only the byteman package we can use the following command:

sudo dnf remove byteman

byteman Package Contents on Fedora 34

/usr/bin/bmcheck
/usr/bin/bminstall
/usr/bin/bmjava
/usr/bin/bmsubmit
/usr/share/byteman/bin/bmcheck
/usr/share/byteman/bin/bminstall
/usr/share/byteman/bin/bmjava
/usr/share/byteman/bin/bmsubmit
/usr/share/byteman/contrib/jboss-modules-system
/usr/share/byteman/contrib/jboss-modules-system/byteman-jboss-modules-plugin.jar
/usr/share/byteman/lib/byteman-install.jar
/usr/share/byteman/lib/byteman-sample.jar
/usr/share/byteman/lib/byteman-submit.jar
/usr/share/byteman/lib/byteman.jar
/usr/share/doc/byteman
/usr/share/doc/byteman/README
/usr/share/java/byteman
/usr/share/java/byteman/byteman-agent.jar
/usr/share/java/byteman/byteman-bmunit5.jar
/usr/share/java/byteman/byteman-install.jar
/usr/share/java/byteman/byteman-jboss-modules-plugin.jar
/usr/share/java/byteman/byteman-jigsaw.jar
/usr/share/java/byteman/byteman-layer.jar
/usr/share/java/byteman/byteman-sample.jar
/usr/share/java/byteman/byteman-submit.jar
/usr/share/java/byteman/byteman.jar
/usr/share/licenses/byteman
/usr/share/licenses/byteman/copyright.txt
/usr/share/maven-metadata/byteman.xml
/usr/share/maven-poms/byteman
/usr/share/maven-poms/byteman/byteman-agent.pom
/usr/share/maven-poms/byteman/byteman-bmunit5.pom
/usr/share/maven-poms/byteman/byteman-install.pom
/usr/share/maven-poms/byteman/byteman-jboss-modules-plugin.pom
/usr/share/maven-poms/byteman/byteman-jboss-modules.pom
/usr/share/maven-poms/byteman/byteman-jigsaw.pom
/usr/share/maven-poms/byteman/byteman-layer.pom
/usr/share/maven-poms/byteman/byteman-root.pom
/usr/share/maven-poms/byteman/byteman-sample.pom
/usr/share/maven-poms/byteman/byteman-submit.pom
/usr/share/maven-poms/byteman/byteman.pom
/usr/share/maven-poms/byteman/tests.pom

References

Summary

In this tutorial we learn how to install byteman on Fedora 34 using yum and dnf.