Setting up BeanShell
1. Download latest BeanShell jar file. The current one is bsh-2.0b4.jar.
2. Place the jar file in a directory say
D:\env\javaLibs\
.3. Set
CLASSPATH
environment variable pointing to BeanShell jar file. It will look like .;D:\env\javaLibs\bsh-2.0b4.jar;
under Windows. The .
is to look for classes in the current directory. If the variable is already present, append the path at the end separating the paths with a semi-colon.4. Open command prompt and run
java bsh.Interpreter
(assuming that JDK or JRE is present in the path).Now we have a fully working Java interpreter which we can use to quickly prototype ideas. The interpreter is similar to what we see in other dynamic languages like Python or Groovy.