[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Importing and Using User Defined Classes



I’ve just started playing with BeanShell and so far it looks great. But I can’t figure out how to import my class definition into it. Say I’ve got a file Foo.java with the contents:

 

class Foo {

   public void test() {

      System.out.println(“test”);

   }

}

 

Then inside the BeanShell, I want to do something like:

 

bsh % import Foo;

bsh % Foo foo = new Foo();     ------   When I hit return here, BeanShell hangs

bsh % foo.test();

 

I would love to get this working. Any help would be much appreciated.

 

Chuck Irvine