Java Beanshell

What is BeanShell?

BeanShell is a small, free, embeddable Java source interpreter with object scripting language features, written in Java. BeanShell executes standard Java statements and expressions but also extends Java into the scripting domain with common scripting language conventions and syntax. BeanShell is a natural scripting language for Java.

How to install BeanShell?

  1. Download bsh-2.0b4.jar from This jar contains all of the packages.
  2. Copy the above file to your $JAVA_HOME/jre/lib/ext folder, or add BeanShell to your classpath (by manipulating the CLASSPATH environment variable)

How to invoke BeanShell from command line?

  • To run as text-only from the command line: java bsh.Interpreter
  • To launch the GUI from command line: java bsh.Console
  • To run BeanShell feeding it as script file: java bsh.Interpreter myfile.bsh
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License