How To Install bsh on Fedora 34

bsh is Lightweight Scripting for Java

Introduction

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

What is bsh

BeanShell is a small, free, embeddable, Java source interpreter with object scripting language features, written in Java. BeanShell executes standard Java statements and expressions, in addition to obvious scripting commands and syntax. BeanShell supports scripted objects as simple method closures like those in Perl and JavaScript(tm). You can use BeanShell interactively for Java experimentation and debugging or as a simple scripting engine for your applications. In short plus some useful stuff. Another way to describe it is to say that in many ways BeanShell is to Java as Tcl/Tk is to C embeddable - You can call BeanShell from your Java applications to execute Java code dynamically at run-time or to provide scripting extensibility for your applications. Alternatively, you can call your Java applications and objects from BeanShell; working with Java objects and APIs dynamically. Since BeanShell is written in Java and runs in the same space as your application, you can freely pass references to “real live” objects into scripts and return them as results.

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

Install bsh 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 bsh using dnf by running the following command:

sudo dnf -y install bsh

Install bsh 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 bsh using yum by running the following command:

sudo yum -y install bsh

How To Uninstall bsh on Fedora 34

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

sudo dnf remove bsh

bsh Package Contents on Fedora 34

/usr/bin/bsh
/usr/bin/bsh-console
/usr/bin/bshdoc
/usr/share/bsh
/usr/share/bsh/webapps
/usr/share/bsh/webapps/bshservlet-wbsh.war
/usr/share/bsh/webapps/bshservlet.war
/usr/share/doc/bsh
/usr/share/doc/bsh/Changes.html
/usr/share/doc/bsh/CodeMap.html
/usr/share/doc/bsh/README.md
/usr/share/doc/bsh/faq.html
/usr/share/java/bsh.jar
/usr/share/licenses/bsh
/usr/share/licenses/bsh/LICENSE
/usr/share/licenses/bsh/NOTICE
/usr/share/maven-metadata/bsh.xml
/usr/share/maven-poms/bsh.pom

References

Summary

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