Internet
Fact-checked

At EasyTechJunkie, we're committed to delivering accurate, trustworthy information. Our expert-authored content is rigorously fact-checked and sourced from credible authorities. Discover how we uphold the highest standards in providing you with reliable knowledge.

Learn more...

What is BeanShell?

Phil Bagda
Phil Bagda

BeanShell is a free Java interpreter that was invented by Pat Niemeyer. It runs on the Java Runtime Environment (JRE) and uses standard Java syntax as well as loose types, command and methox closures. BeanShell adds script-like functionalities to the Java language. Like Javascript, it is an object-based scripting language. It was accepted as a Java specification request (JSR), which is the first step for a full integration in the Java programming language.

As a Java interpreter, BeanShell can be used to interpret regular Java syntax, but it also can interpret its own syntax, which can be used to scale Java from a static to a dynamic programming language. BeanShell has been unofficially named Little Java by programmers because it closely resembles the syntax of the Java programming language in many respects. It does, however, add the support of many new features, such as loosely typed variables, in which the variable does not have to be declared first. BeanShell also supports scripted objects as simple method closures and Abstract Windows Toolkit/Swing events handlers.

Man holding computer
Man holding computer

BeanShell has a website from which it can be downloaded. The website can be located by typing "BeanShell" into any Internet search engine. On this website, users will find many options and can download the BSH package, which includes the core interpreter, the shell commands and the utilities.

Users whose version of Java does not include Swing must add the swingall Java archive (JAR) file to the classpath. Some of the utilities use Swing. After Swing has been set up in the classpath, BeanShell will then work in a console interactive interpreter or graphical interactive interpreter.

BeanShell is an open-source project. It is small and embeddable. BeanShell has been integrated in many applications, including testing, configuration, embedded systems, rules engines, user scripting extension, rapid prototyping, dynamic deployment and even Java education.

Discuss this Article

Post your comments
Login:
Forgot password?
Register:
    • Man holding computer
      Man holding computer