Hi, I was wondering if anyone knows where I can find an example of adding commands to beanshell implemented in Java. I have seen the dir() command and I have been able to get my command to work by adding my .class file to the /bsh/commands folder inside the bsh-1.2b7.jar file. However, when I try to put my command into the class path, it doesn't work. When I run in the beanshell GUI, I get a call stack with "at bsh.BSHMethodInvocation.eval(Unknown Source)" at the top. When I run standalone in a debugger, I get the error "Evaluation Error: Sourced file: D:\java\projects\fiik-test\bsh\testapr2.bsh : Command not found: testapr_cmd : at Line: 67 : in file: D:\java\projects\fiik-test\bsh\testapr2.bsh : APR = testapr_cmd ( payment , intRate , loanAmount , term , days )"
My command looks like this:
package fiik.bsh.commands;
import bsh.Interpreter;
import bsh.NameSpace;
public class testapr_cmd
 public static String usage() {
  return "usage: double testapr_cmd(double payment, double intRate, double loanAmount, int term, int days)";
  public static double invoke(Interpreter env, NameSpace namespace,
  double payment, double intRate, double loanAmount, int term, int days)
  env.println("Inside command");
  return intRate;
And I'm trying to call it like this:
double payment = 980;
double intRate = 11.0;
double loanAmount = 100000.0;
int term = 360;
int days = 45;
print("Current classpath");
cp = getClassPath();
for (i = 0; i < cp.length; ++i)
 o = cp[i];
APR = testapr_cmd(payment, intRate, loanAmount, term, days);

Thank you,